source: dist/deb/Makefile @ acbabee

Last change on this file since acbabee was 5f4d9c3, checked in by Maciej Prill <mprill@…>, 13 years ago

Rewritten the build system, added lem UTF-8 version.

  • Property mode set to 100644
File size: 2.5 KB
Line 
1#default task
2
3DIR=$(shell pwd)
4
5ifndef UTT_DIST_DIR
6        UTT_DIST_DIR=${DIR}
7endif
8
9ifndef UTT_DIST_OUTPUT
10        UTT_DIST_OUTPUT=${DIR}
11endif
12
13# here there're few properties
14_PRODUCT_NAME=utt
15_UTT_VER=$(shell cat ../common/version.def)
16_UTT_REL=$(shell cat ../common/release.def)
17_DEB_FROOT=$(DIR)/deb_root
18_UTT_DIR=${_DEB_FROOT}/usr/local/$(_PRODUCT_NAME).$(_UTT_VER)-$(_UTT_REL)
19
20.PHONY: default
21default: make_control make_postinst make_prerm
22        # first, we prepare some directory structure
23        mkdir -p $(_DEB_FROOT)/DEBIAN
24        mkdir -p $(_UTT_DIR)
25
26        # next, we copy deb package files
27        mv ./control $(_DEB_FROOT)/DEBIAN/
28        mv ./postinst $(_DEB_FROOT)/DEBIAN/
29        mv ./prerm $(_DEB_FROOT)/DEBIAN/
30        cd ${_DEB_FROOT} && tar -cvvf control.tar.gz DEBIAN/
31        cd ${DIR};
32        rm -fr ${_DEB_FROOT}/DEBIAN/
33
34        # we copy all necessery files (binaries)
35        cp -r ${UTT_DIST_DIR}/* ${_UTT_DIR}/
36        cp ./changelog ${_UTT_DIR}/share/doc/$(_PRODUCT_NAME)/
37#       gzip --best $(_DEB_ROOT)/usr/share/doc/$(_PRODUCT_NAME)/changelog
38        cp ./changelog.Debian $(_UTT_DIR)/share/doc/$(_PRODUCT_NAME)/
39#       gzip --best $(_DEB_ROOT)/usr/share/doc/$(_PRODUCT_NAME)/changelog.Debian
40        cp ../files/* ${_UTT_DIR}/share/doc/${_PRODUCT_NAME}/
41        cp ../common/utt_make_config.pl ${_UTT_DIR}/bin/
42        chmod 755 ${_UTT_DIR}/bin/utt_make_config.pl
43       
44
45
46#       # next we make man/doc archives
47#       gzip --best $(_DEB_ROOT)/usr/share/man/man1/$(_PRODUCT_NAME).1
48
49        find $(_DEB_FROOT) -type d | xargs chmod 755   # this is necessary on Debian Woody, don't ask me why
50
51        # finally, we buid deb package
52        fakeroot dpkg-deb --build $(_DEB_FROOT)
53        mv $(_DEB_FROOT).deb $(_PRODUCT_NAME)_$(_UTT_VER)-$(_UTT_REL).all.deb
54        rm -rf ${_DEB_FROOT}
55       
56
57
58.PHONY: make_control
59make_control:
60        echo "Package: $(_PRODUCT_NAME)" > control
61        echo "Version: $(_UTT_VER)" >> control
62        echo "Section: web" >> control
63        echo "Priority: optional" >> control
64        echo "Architecture: all" >> control
65        echo "Essential: no" >> control
66
67        echo "Depends: " >> control
68# here we read this information from file ../common/requirements.def
69        #libwww-perl, acme-base (>= 1.2)         <= wymagania pakietowe
70
71        echo "Pre-Depends: perl" >> control
72
73        echo "Maintainer: Adam Mickiewicz University" >> control
74        echo "Provides: $(_PRODUCT_NAME)" >> control
75        echo -n "Description: " >> control
76        cat ../common/description.def >> control
77
78.PHONY: make_postinst
79make_postinst:
80        echo "#!/bin/sh" > postinst
81        echo "$(_INSTALL_DIR)/create_utt_config.pl" >> postinst
82        echo "rm -f $(_INSTALL_DIR)/create_utt_config.pl" >> postinst
83
84.PHONY: make_prerm
85make_prerm:
86        echo "#!/bin/sh" > prerm
Note: See TracBrowser for help on using the repository browser.