1 # Example custom makefile for creating .deb without using dpkg tools.
3 # Author: Tim Wegener <twegener@madabar.com>
5 # This requires deb_hand.mak
8 # SOURCE_DIR - directory containing files to be packaged
9 # ICON_SOURCE - 26x26 icon file for maemo
10 # description.txt - description with summary on first line
11 # preinst, postinst, prerm, postrm - optional control shell scripts
13 PACKAGE = beats-applet
18 DEPENDS = python2.5, python2.5-gobject, python2.5-gtk2, python2.5-osso, python2.5-hildon, python2.5-mutagen
19 MAINTAINER = Paul Philippov <paul@ppds.ws>
23 ICON_SOURCE = ${SOURCE_DIR}/beats26.png
24 CTRL_EXTRAS ?= ${wildcard preinst postinst prerm postrm}
26 ${PACKAGE_DIR}/data: ${SOURCE_DIR}
29 mkdir -p $@/usr/lib/hildon-desktop
30 cp ${SOURCE_DIR}/beats-applet.py $@/usr/lib/hildon-desktop/
31 mkdir -p ${PACKAGE_DIR}/data/usr/share/applications/hildon-home
32 cp ${SOURCE_DIR}/beats-applet.desktop $@/usr/share/applications/hildon-home/
33 mkdir -p ${PACKAGE_DIR}/data/usr/share/pixmaps
34 cp ${SOURCE_DIR}/beats26.png $@/usr/share/pixmaps/beats.png
35 mkdir -p ${PACKAGE_DIR}/data/usr/share/icons/hicolor/26x26/apps
36 cp ${SOURCE_DIR}/beats26.png $@/usr/share/icons/hicolor/26x26/apps/beats.png
37 mkdir -p ${PACKAGE_DIR}/data/usr/share/icons/hicolor/128x128/apps
38 cp ${SOURCE_DIR}/beats128.png $@/usr/share/icons/hicolor/128x128/apps/beats.png
39 mkdir -p ${PACKAGE_DIR}/data/usr/share/icons/hicolor/scalable/apps
40 cp ${SOURCE_DIR}/beats.svg $@/usr/share/icons/hicolor/scalable/apps
41 mkdir -p ${PACKAGE_DIR}/data/usr/share/beats
42 cp ${SOURCE_DIR}/prefs.glade $@/usr/share/beats/
44 ${PACKAGE_DIR}/control: ${PACKAGE_DIR}/data ${CTRL_EXTRAS} description.txt ${ICON_SOURCE}
48 ifneq (${CTRL_EXTRAS},)
52 echo "Package: ${PACKAGE}" > $@/control
53 echo "Version: ${VERSION}" >> $@/control
54 echo "Section: ${SECTION}" >> $@/control
55 echo "Priority: ${PRIORITY}" >> $@/control
56 echo "Architecture: ${ARCH}" >> $@/control
57 echo "Depends: ${DEPENDS}" >> $@/control
58 echo "Installed-Size: ${shell du -s ${PACKAGE_DIR}/data | cut -f1}" >> $@/control
59 echo "Maintainer: ${MAINTAINER}" >> $@/control
60 echo -n "Description:" >> $@/control
61 cat description.txt | gawk '{print " "$$0;}' >> $@/control
63 ifneq (${ICON_SOURCE},)
64 echo "Maemo-Icon-26:" >> $@/control
65 base64 ${ICON_SOURCE} | gawk '{print " "$$0;}' >> $@/control
68 cd ${PACKAGE_DIR}/data && find . -type f -exec md5sum {} \; | sed -e 's| \./||' > $@/md5sums
70 ${PACKAGE_DIR}/debian-binary:
73 ${PACKAGE_DIR}/build: ${PACKAGE_DIR}/debian-binary ${PACKAGE_DIR}/control
77 cp ${PACKAGE_DIR}/debian-binary $@/
78 cd ${PACKAGE_DIR}/control && tar czvf $@/control.tar.gz ./*
79 cd ${PACKAGE_DIR}/data && tar czvf $@/data.tar.gz ./*
81 ${PACKAGE_DIR}/${PACKAGE}_${VERSION}_${ARCH}.deb: ${PACKAGE_DIR}/build
82 ar -rc $@tmp $</debian-binary $</control.tar.gz $</data.tar.gz
83 sed -e 's|^\([^/]\+\)/ \(.*\)|\1 \2|g' $@tmp > $@fail
88 data: ${PACKAGE_DIR}/data
91 control: ${PACKAGE_DIR}/control
94 build: ${PACKAGE_DIR}/build
97 deb: ${PACKAGE_DIR}/${PACKAGE}_${VERSION}_${ARCH}.deb
100 rm -rf ${PACKAGE_DIR}/debian_binary ${PACKAGE_DIR}/control ${PACKAGE_DIR}/data ${PACKAGE_DIR}/build