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
|
#!/usr/bin/make -f
package = unzip
docdir = debian/tmp/usr/share/doc/$(package)
history = History.600
CC = gcc
export DEB_BUILD_MAINT_OPTIONS=hardening=-format
CFLAGS := `dpkg-buildflags --get CFLAGS` -Wall
ifeq ($(DEB_HOST_ARCH),armhf)
CFLAGS := `DEB_CFLAGS_STRIP=-O2 dpkg-buildflags --get CFLAGS` -Wall
endif
LDFLAGS := `dpkg-buildflags --get LDFLAGS`
CPPFLAGS := `dpkg-buildflags --get CPPFLAGS`
DEFINES = -DACORN_FTYPE_NFS -DWILD_STOP_AT_DIR -DLARGE_FILE_SUPPORT \
-DUNICODE_SUPPORT -DUNICODE_WCHAR -DUTF8_MAYBE_NATIVE -DNO_LCHMOD \
-DDATE_FORMAT=DF_YMD -DUSE_BZIP2 -DIZ_HAVE_UXUIDGID -DNOMEMCPY \
-DNO_WORKING_ISPRINT
STRIP = true
DEB_BUILD_GNU_TYPE := $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
DEB_HOST_GNU_TYPE := $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
ifneq ($(DEB_HOST_GNU_TYPE),$(DEB_BUILD_GNU_TYPE))
CC=$(DEB_HOST_GNU_TYPE)-gcc
STRIPCMD=$(DEB_HOST_GNU_TYPE)-strip
else
STRIPCMD=strip
endif
ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
STRIP = $(STRIPCMD) --remove-section=.comment --remove-section=.note
endif
build:
$(MAKE) -f unix/Makefile D_USE_BZ2=-DUSE_BZIP2 L_BZ2=-lbz2 \
CC="$(CC)" LF2="$(LDFLAGS)" \
CF="$(CFLAGS) $(CPPFLAGS) -I. $(DEFINES)" unzips
touch build
clean:
rm -f build
$(MAKE) -f unix/Makefile clean
rm -rf *~ debian/tmp debian/*~ debian/files* debian/substvars
binary-indep: build
binary-arch: build
rm -rf debian/tmp
install -d debian/tmp/DEBIAN $(docdir)
cd debian/tmp && install -d usr/bin usr/man/man1 usr/lib/mime/packages
$(MAKE) -f unix/Makefile install prefix=`pwd`/debian/tmp/usr
install -m 755 debian/postinst debian/postrm debian/tmp/DEBIAN
install -m 644 debian/mime debian/tmp/usr/lib/mime/packages/$(package)
cat debian/copyright.in LICENSE > $(docdir)/copyright
cp debian/changelog $(docdir)/changelog.Debian
cp -p History.* BUGS ToDo $(docdir)
cd $(docdir) && gzip -9 changelog.Debian History.*
ln -s $(history).gz $(docdir)/changelog.gz
cd debian/tmp/usr/bin && $(STRIP) funzip unzip unzipsfx zipinfo
gzip -r9 debian/tmp/usr/man
cd debian/tmp && mv usr/man usr/share
dpkg-shlibdeps debian/tmp/usr/bin/unzip
dpkg-gencontrol
cd debian/tmp && \
md5sum `find * -type f ! -regex "DEBIAN/.*"` > DEBIAN/md5sums
chown -R 0:0 debian/tmp
chmod -R go=rX debian/tmp
dpkg --build debian/tmp ..
binary: binary-indep binary-arch
build-arch: build
build-indep: build
.PHONY: binary binary-arch binary-indep clean
|