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
|
#!/usr/bin/make -f
# Debian package information
source := $(shell grep "^Source: " debian/control|head -1|sed 's/Source: \(.*\)/\1/g')
PACKAGE := $(shell grep "^Package: " debian/control|head -1|sed 's/Package: \(.*\)/\1/g')
version := $(shell grep "^$(source) " debian/changelog|head -1 |sed 's/.*(\(.*\)\-[^\-]*).*/\1/g')
revision := $(shell grep "^$(source) " debian/changelog|head -1 |sed 's/.*([^\-]*\-\(.*\)).*/\1/g')
bindir := /usr/bin/
docdir := /usr/share/doc/$(PACKAGE)
ETCDIR :=
mandir := /usr/share/man/man1/
TMPDIR := $(CURDIR)/debian/tmp/
SRCDIR := ./
CLEANFILES := Crux/gtk/gtkrc capplet/Makefile
DOCFILES :=
UPSTREAM := src/.libs/libeazel-engine.so
program := $(SRCDIR)$(UPSTREAM)
APPNAME := /usr/lib/gtk/themes/engines/libeazel-engine.so
FILES :=
LOCATION :=
MANPAGE :=
INSTALL := install
INSTALL_DIR := $(INSTALL) -p -d -o root -g root -m 755
INSTALL_FILE := $(INSTALL) -p -o root -g root -m 644
INSTALL_PROGRAM := $(INSTALL) -p -o root -g root -m 755
INSTALL_SCRIPT := $(INSTALL) -p -o root -g root -m 755
CFLAGS := -O2 -Wall
ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS)))
CFLAGS += -g
endif
ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
INSTALL_PROGRAM += -s
endif
debian_patches = 001-cvs 25config 50build 75install gtkrc
build: patched-stamp $(program)
$(program): config.status
test -d debian
cd $(SRCDIR) && $(MAKE)
config.status:
test -d debian
cd $(SRCDIR) && CFLAGS="$(CFLAGS)" ./configure --prefix=/usr
# Patches *must* be applied before running make clean, since they patch the Makefile.
clean: $(PACKAGE)clean reverse-patches
-rm -f *~
$(PACKAGE)clean: debclean patched-stamp
-(cd $(SRCDIR) && $(MAKE) distclean)
-(if [ -n "$(CLEANFILES)" ]; then rm -f $(CLEANFILES); fi)
checkroot:
test 0 = "`id -u`"
debclean: checkroot
test -d debian
rm -rf $(TMPDIR)
rm -rf debian/files* debian/substvars
binary-indep:
@echo Nothing to do
binary-arch: debclean build
# Setup directories
$(INSTALL_DIR) $(TMPDIR)/DEBIAN $(TMPDIR)$(docdir) $(TMPDIR)$(ETCDIR)
$(MAKE) install DESTDIR=$(TMPDIR)
# Install documentation
if [ -n "$(DOCFILES)" ]; then \
set -e ; for i in "$(DOCFILES)" ; do \
$(INSTALL_FILE) $$i $(TMPDIR)$(docdir)/ ; \
done \
fi
if [ -n "$(MANPAGE)" -a -f "$(MANPAGE)" ]; then \
$(INSTALL_DIR) $(TMPDIR)$(mandir) ; \
$(INSTALL_FILE) $(MANPAGE) $(TMPDIR)$(mandir) ; \
find $(TMPDIR)$(mandir) -type f -exec gzip -9v {} \; ; \
fi
# Install Debian-only documentation
$(INSTALL_FILE) debian/changelog \
$(TMPDIR)$(docdir)/changelog.Debian
@#gzip -9f $(TMPDIR)/$(docdir)/*Debian
$(INSTALL_FILE) debian/copyright $(TMPDIR)$(docdir)
# Special case rules
-rm -f $(TMPDIR)/usr/lib/gtk/themes/engines/libeazel-engine.la
ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
strip --strip-unneeded --remove-section=.comment --remove-section=.note $(TMPDIR)$(APPNAME)
endif
chmod 644 $(TMPDIR)$(APPNAME)
# Install package scripts and other management files
for i in debian/postinst debian/prerm; do \
TARGET=$(TMPDIR)/DEBIAN/`basename $$i` ; \
sh $$i > $$TARGET $(PACKAGE) ; \
chmod 755 $$TARGET ; \
done
if [ -f debian/conffiles ]; then \
$(INSTALL_FILE) debian/conffiles $(TMPDIR)/DEBIAN ; \
fi
# Build package
dpkg-shlibdeps $(TMPDIR)$(APPNAME)
dpkg-gencontrol -isp -p$(PACKAGE)
chown -R root:root $(TMPDIR)
chmod -R go=rX $(TMPDIR)
dpkg --build $(TMPDIR) ..
binary: binary-indep binary-arch
.PHONY: build binary binary-arch binary-indep clean checkroot
# ---------------------------------------------------------------------------
# various rules to unpack addons and (un)apply patches.
# borrowed from egcs package
patch_dir = debian/patches
apply-patches: patched-stamp
reverse-patches:
@for stamp in none patched-*; do \
case "$$stamp" in none|patched-stamp|patched-\*) continue; esac; \
patch=`echo $$stamp | sed -e 's/patched-//'`; \
echo "trying to revert patch $$patch ..."; \
if [ -x $(patch_dir)/$$patch.dpatch ]; then true; else \
chmod +x $(patch_dir)/$$patch.dpatch; fi; \
if $(patch_dir)/$$patch.dpatch -unpatch; then \
echo "reverted $$patch patch."; \
rm -f $$stamp; \
else \
echo "error in reverting $$patch patch."; \
exit 1; \
fi; \
done
@echo "Removing patched-stamp"
@rm -f patched-stamp
patched-%: $(patch_dir)/%.dpatch
@if [ -x $< ]; then true; else chmod +x $<; fi
@if [ -f $@ ]; then \
echo "$* patches already applied."; exit 1; \
fi
$< -patch
@echo "$* patches applied." > $@
patched-stamp: $(foreach p,$(debian_patches),patched-$(p))
@echo -e "\nPatches applied:" >> pxxx
@for i in none $(debian_patches); do \
if [ -r debian/patches/$$i.dpatch ]; then \
echo -e "\n$$i:" >> pxxx; \
sed -n 's/^# *DP: */ /p' debian/patches/$$i.dpatch >> pxxx; \
fi \
done
@echo "Writing patched-stamp"
@mv -f pxxx patched-stamp
# vi: ts=8 sw=8 ai nowrap
|