1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180
|
#!/usr/bin/make -f
# Reworked from the bottom up, October 1998
# by Daniel Martin <fizbin@debian.org>
# Reworked somewhat after the style of Manoj Srivastava's "make" package's
# debian/rules file.
SHELL = /bin/bash
package = fvwm95
icon_package = fvwm95-icons
topdir := $(shell pwd)
package_tmp = debian/tmp
icon_package_tmp = debian/tmp-icon
package_tmp_a = $(topdir)/debian/tmp
icon_package_tmp_a = $(topdir)/debian/tmp-icon
package_subdirs = fvwm modules
icon_package_subdirs = icons mini-icons
FILES_TO_CLEAN = TAGS tags debian/files* config.cache debian/substvars
DIRS_TO_CLEAN = $(package_tmp) $(icon_package_tmp)
STAMPS_TO_CLEAN = stamp-configure stamp-build
install_file= install -p -o root -g root -m 644
install_program= install -p -o root -g root -m 755
make_directory= install -d -o root -g root -m 755
configure: stamp-configure
stamp-configure:
$(checkdir)
(INSTALL_PROGRAM="/usr/bin/install -s"; export INSTALL_PROGRAM ; \
CFLAGS="-O2 -g -Wall -Wno-unused"; export CFLAGS ; \
./configure --prefix=/usr/X11R6)
touch stamp-configure
build: stamp-build
stamp-build: stamp-configure
$(checkdir)
${MAKE}
touch stamp-build
clean:
$(checkdir)
-rm -f $(STAMPS_TO_CLEAN)
-test -f Makefile && $(MAKE) distclean
-rm -f $(FILES_TO_CLEAN)
-rm -rf $(DIRS_TO_CLEAN)
-rm -f `find . \( -name '*.o' -o -name core -o -name '*.rej' \
-o -name '*~' \
-o -name '*.bak' -o -name '#*#' -o -name '.*.orig' \
-o -name '.*.rej' -o -name '.SUMS' -o -size 0 \) -print`
binary-indep: checkroot stamp-build
$(checkdir)
-rm -rf $(icon_package_tmp)
$(make_directory) $(icon_package_tmp) $(icon_package_tmp)/DEBIAN
$(make_directory) $(icon_package_tmp)/usr/share/icons
$(make_directory) $(icon_package_tmp)/usr/share/fvwm95/icons
$(install_file) debian/debmenu.xpm \
$(icon_package_tmp)/usr/share/fvwm95/icons
for i in ${icon_package_subdirs}; do \
echo Installing in $$i ; \
$(make_directory) $(icon_package_tmp)/usr/share/fvwm95/$$i ; \
(cd $$i; ${MAKE} install icon_dir=$(icon_package_tmp_a)/usr/share/fvwm95/$$i) \
done
$(make_directory) $(icon_package_tmp)/usr/share/doc/$(icon_package)/
$(install_program) debian/postinst.$(icon_package) \
$(icon_package_tmp)/DEBIAN/postinst
$(install_program) debian/prerm.$(icon_package) \
$(icon_package_tmp)/DEBIAN/prerm
$(install_file) debian/copyright \
$(icon_package_tmp)/usr/share/doc/$(icon_package)/copyright
$(install_file) debian/changelog $(icon_package_tmp)/usr/share/doc/$(icon_package)/changelog.Debian
gzip -9fq $(icon_package_tmp)/usr/share/doc/$(icon_package)/changelog.Debian
dpkg-gencontrol -isp -p$(icon_package) -P$(icon_package_tmp)
chown -R root.root $(icon_package_tmp)
chmod -R g-ws $(icon_package_tmp)
dpkg --build $(icon_package_tmp) ..
binary-arch: checkroot stamp-build
$(checkdir)
-rm -rf $(package_tmp)
$(make_directory) $(package_tmp) $(package_tmp)/DEBIAN
$(make_directory) $(package_tmp)/usr/X11R6/bin
$(make_directory) $(package_tmp)/usr/X11R6/lib
$(make_directory) $(package_tmp)/usr/X11R6/lib/X11/fvwm95
$(make_directory) $(package_tmp)/etc/X11/fvwm95
$(make_directory) $(package_tmp)/etc/X11/fvwm95/.fvwm95
$(make_directory) $(package_tmp)/usr/X11R6/man/man{1,5}
$(make_directory) $(package_tmp)/usr/lib/menu
$(make_directory) $(package_tmp)/usr/share/doc $(package_tmp)/usr/share/doc/fvwm95
$(make_directory) $(package_tmp)/etc/menu-methods
@for i in ${package_subdirs}; do \
echo Installing in $$i ; \
(cd $$i; $(MAKE) install prefix=$(package_tmp_a)/usr/X11R6 \
fvwm_dir=$(package_tmp_a)/usr/X11R6/lib/X11/fvwm95 \
man_dir=$(package_tmp_a)/usr/X11R6/man/man5 \
icon_dir=$(package_tmp_a)/usr/share/fvwm95/icons) \
done
(cd $(package_tmp)/usr/X11R6/man/man5; rm -f fvwm95.1 fvwm95.1x; \
for i in *.1; do \
mv $$i `basename $$i .1`.5fvwm95; \
done)
test -f $(package_tmp)/usr/X11R6/man/man1/fvwm95.1x || \
$(install_file) fvwm/fvwm95.man $(package_tmp)/usr/X11R6/man/man1/fvwm95.1x
$(install_file) sample.fvwmrc/system.fvwm95rc \
$(package_tmp)/usr/share/doc/fvwm95/
$(install_file) debian/fvwm95rc \
$(package_tmp)/etc/X11/fvwm95/system.fvwm95rc
$(install_file) debian/*.hook \
$(package_tmp)/etc/X11/fvwm95/
mv $(package_tmp)/etc/X11/fvwm95/null.hook \
$(package_tmp)/etc/X11/fvwm95/.fvwm95/null.hook
ln -s /etc/X11/fvwm95/system.fvwm95rc \
$(package_tmp)/usr/X11R6/lib/X11/fvwm95/.fvwm95rc
ln -s /etc/X11/fvwm95/.fvwm95 \
$(package_tmp)/usr/X11R6/lib/X11/fvwm95/.fvwm95
(cd $(package_tmp)/etc/X11/fvwm95/.fvwm95; \
for i in init-restart.hook main-menu.hook post.hook init.hook \
menudefs.hook pre.hook main-menu-pre.hook restart.hook; \
do ln -s null.hook $$i; done)
mv $(package_tmp)/usr/X11R6/lib/X11/fvwm95/scripts \
$(package_tmp)/usr/share/doc/fvwm95/FvwmScript-examples
#Debian menus
$(install_program) debian/menu-method $(package_tmp)/etc/menu-methods/fvwm95
$(install_file) debian/menu $(package_tmp)/usr/lib/menu/fvwm95
#Debian installation scripts/other files
#debstd -m INSTALL README *.lsm docs/* debian/README.sysrc debian/example.fvwm95rc_menu
$(install_file) INSTALL README *.lsm debian/README.sysrc \
debian/README.debian \
$(package_tmp)/usr/share/doc/$(package)
$(make_directory) $(package_tmp)/usr/share/doc/$(package)/html
$(install_file) docs/GPL.html docs/color_combos docs/error_codes \
docs/example.fvwm95rc docs/example.fvwm95rc.fr \
docs/m4_hacks docs/modules.tex docs/index.html \
$(package_tmp)/usr/share/doc/$(package)
$(install_file) docs/html/* $(package_tmp)/usr/share/doc/$(package)/html
$(make_directory) $(package_tmp)/usr/share/doc/$(package)/examples
$(install_file) `cat debian/examples` \
$(package_tmp)/usr/share/doc/$(package)/examples
gzip -9frq $(package_tmp)/usr/share/doc/$(package)
gzip -9fqr $(package_tmp)/usr/X11R6/man
$(install_file) debian/copyright \
$(package_tmp)/usr/share/doc/$(package)/copyright
$(install_file) debian/changelog $(package_tmp)/usr/share/doc/$(package)/changelog.Debian
gzip -9fq $(package_tmp)/usr/share/doc/$(package)/changelog.Debian
$(install_file) Changelog $(package_tmp)/usr/share/doc/$(package)/changelog
$(install_file) debian/conffiles $(package_tmp)/DEBIAN/conffiles
$(install_program) debian/preinst $(package_tmp)/DEBIAN/preinst
$(install_program) debian/prerm $(package_tmp)/DEBIAN/prerm
$(install_program) debian/postinst $(package_tmp)/DEBIAN/postinst
$(install_program) debian/postrm $(package_tmp)/DEBIAN/postrm
dpkg-shlibdeps $(package_tmp)/usr/X11R6/bin/fvwm95 \
$(package_tmp)/usr/X11R6/lib/X11/fvwm95/Fvwm*
dpkg-gencontrol -isp -p$(package) -P$(package_tmp)
chown -R root.root $(package_tmp)
chmod -R g-ws $(package_tmp)
dpkg --build $(package_tmp) ..
define checkdir
test -f debian/rules
endef
# Below here is fairly generic really
binary: binary-indep binary-arch
source diff:
@echo >&2 'source and diff are obsolete - use dpkg-source -b'; false
checkroot:
$(checkdir)
test root = "`whoami`"
.PHONY: binary binary-arch binary-indep clean checkroot
|