source: app/dist/deb/Makefile @ ac7d970

help
Last change on this file since ac7d970 was d593c5e, checked in by pawelk <pawelk@…>, 17 years ago

Testowałem działanie generowania domyślnej konfiguracji. Brakuje jakiś modułów. :(

git-svn-id: svn://atos.wmid.amu.edu.pl/utt@12 e293616e-ec6a-49c2-aa92-f4a8b91c5d16

  • Property mode set to 100644
File size: 2.5 KB
RevLine 
[25ae32e]1#default task
2
[d593c5e]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
[25ae32e]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)
[d593c5e]17_DEB_FROOT=$(DIR)/deb_root
18_UTT_DIR=${_DEB_FROOT}/usr/local/$(_PRODUCT_NAME).$(_UTT_VER)-$(_UTT_REL)
[25ae32e]19
20.PHONY: default
[d593c5e]21default: make_control make_postinst make_prerm
[25ae32e]22        # first, we prepare some directory structure
[d593c5e]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)/
[25ae32e]37#       gzip --best $(_DEB_ROOT)/usr/share/doc/$(_PRODUCT_NAME)/changelog
[d593c5e]38        cp ./changelog.Debian $(_UTT_DIR)/share/doc/$(_PRODUCT_NAME)/
[25ae32e]39#       gzip --best $(_DEB_ROOT)/usr/share/doc/$(_PRODUCT_NAME)/changelog.Debian
[d593c5e]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       
[25ae32e]44
45
[d593c5e]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
[25ae32e]50
51        # finally, we buid deb package
[d593c5e]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       
[25ae32e]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.