diff options
Diffstat (limited to 'debian/rules')
-rwxr-xr-x | debian/rules | 109 |
1 files changed, 109 insertions, 0 deletions
diff --git a/debian/rules b/debian/rules new file mode 100755 index 0000000..da95ab0 --- /dev/null +++ b/debian/rules @@ -0,0 +1,109 @@ +#!/usr/bin/make -f + +STRIP =strip +ifneq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS))) + STRIP =: nostrip +endif + +CFLAGS =-g -O2 -Wall +LDFLAGS = +CC =gcc +BGLIBS =/usr/lib/bglibs +ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) + CFLAGS =-g -O0 -Wall +endif +ifneq (,$(findstring diet,$(DEB_BUILD_OPTIONS))) + CC =diet -v -Os gcc -nostdinc + BGLIBS =/usr/lib/diet/bglibs +endif + +DIR =$(shell pwd)/debian/twoftpd + +patch: deb-checkdir patch-stamp +patch-stamp: + for i in `ls -1 debian/diff/*.diff || :`; do \ + patch -p1 <$$i || exit 1; \ + done + touch patch-stamp + +build: deb-checkdir build-arch-stamp build-indep-stamp + +build-arch: deb-checkdir build-arch-stamp +build-arch-stamp: patch-stamp + -gcc -v + for i in conf-*; do \ + test -e $${i%'{orig}'}'{orig}' || cp -v $$i $$i'{orig}'; \ + done + echo '$(CC) $(CFLAGS)' >conf-cc + echo '$(CC) $(LDFLAGS)' >conf-ld + echo '/usr/bin' >conf-bin + echo '$(BGLIBS)/include' >conf-bgincs + echo '$(BGLIBS)/lib' >conf-bglibs + $(MAKE) + touch build-arch-stamp + +build-indep: deb-checkdir build-indep-stamp +build-indep-stamp: + touch build-indep-stamp + +clean: deb-checkdir deb-checkuid patch + $(MAKE) clean + for i in `ls *'{orig}' || :`; do mv -vf $$i $${i%'{orig}'}; done + test ! -e patch-stamp || \ + for i in `ls -1r debian/diff/*.diff || :`; do patch -p1 -R <$$i; done + rm -f build-arch-stamp build-indep-stamp patch-stamp + rm -rf '$(DIR)' '$(DIR)'-run + rm -f debian/files debian/substvars changelog + +install: install-arch install-indep +install-arch: deb-checkdir deb-checkuid build-arch-stamp + rm -rf '$(DIR)' + install -d -m0755 '$(DIR)'/usr/bin + install -d -m0755 '$(DIR)'/usr/share/man/man1 + echo '$(DIR)'/usr/bin >conf-bin + echo '$(DIR)'/usr/share/man >conf-man + PATH=$$PATH:/usr/lib/bglibs/bin/ $(MAKE) install + $(STRIP) -R .comment -R .note '$(DIR)'/usr/bin/* + chmod 0644 '$(DIR)'/usr/share/man/man1/*.1 + gzip -9 '$(DIR)'/usr/share/man/man1/*.1 + test -r changelog || ln -s ChangeLog changelog + +install-indep: deb-checkdir deb-checkuid build-indep-stamp + rm -rf '$(DIR)'-run + install -d -m0755 '$(DIR)'-run/etc/twoftpd/log + install -d -m0755 '$(DIR)'-run/etc/twoftpd/env + install -m0755 debian/etc/twoftpd/run '$(DIR)'-run/etc/twoftpd/ + install -m0755 debian/etc/twoftpd/log/run '$(DIR)'-run/etc/twoftpd/log/ + for i in debian/etc/twoftpd/env/*; do \ + test -d $$i || install -m0644 $$i '$(DIR)'-run/etc/twoftpd/env/ \ + || exit 1; \ + done + install -d -m0755 '$(DIR)'-run/etc/twoftpd-anon/log + install -d -m0755 '$(DIR)'-run/etc/twoftpd-anon/env + install -m0755 debian/etc/twoftpd-anon/run \ + '$(DIR)'-run/etc/twoftpd-anon/run + install -m0755 debian/etc/twoftpd-anon/log/run \ + '$(DIR)'-run/etc/twoftpd-anon/log/run + for i in debian/etc/twoftpd-anon/env/*; do \ + test -d $$i || install -m0644 $$i '$(DIR)'-run/etc/twoftpd-anon/env/ \ + || exit 1; \ + done + install -d -m0755 '$(DIR)'-run/var/log/twoftpd + install -d -m0755 '$(DIR)'-run/var/log/twoftpd-anon + test -r changelog || ln -s ChangeLog changelog + +binary-arch: deb-checkdir deb-checkuid install-arch twoftpd.deb + test '$(CC)' != 'gcc' || dpkg-shlibdeps '$(DIR)'/usr/bin/* + dpkg-gencontrol -isp -ptwoftpd -P'$(DIR)' + dpkg -b '$(DIR)' .. + +binary-indep: deb-checkdir deb-checkuid install-indep twoftpd-run.deb + dpkg-gencontrol -isp -ptwoftpd-run -P'$(DIR)'-run + dpkg -b '$(DIR)'-run .. + +binary: binary-indep binary-arch + +.PHONY: patch build build-arch build-indep clean install install-arch \ +install-indep binary-arch binary-indep binary + +include debian/implicit |