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
|
#! /usr/bin/make -f
# Debhelper options
#export DH_VERBOSE=1
export DH_COMPAT=2
# DBS options
package := rmagic
PWD := $(shell pwd)
CFLAGS := -O2 -Wall
INSTALL = install
INSTALL_DATA := $(INSTALL) -m644
INSTALL_DIR := $(INSTALL) -p -d -o root -g root -m 755
INSTALL_FILE := $(INSTALL) -p -o root -g root -m 644
INSTALL_PROGRAM := $(INSTALL) -m755
INSTALL_SCRIPT := $(INSTALL) -p -o root -g root -m 755
SCRIPT_DIR = /usr/share/dbs
# the dbs rules
TAR_DIR := rmagic-2.13
include $(SCRIPT_DIR)/dbs-build.mk
# dpkg-arch rules
ifeq (,$(DEB_BUILD_GNU_TYPE))
include $(SCRIPT_DIR)/dpkg-arch.mk
endif
# Some vars needed for clean building the package
DEBIAN_ROOT := $(PWD)/debian/$(package)
# Make rules
configure: $(STAMP_DIR)/stamp-configure
$(STAMP_DIR)/stamp-configure: $(patched)
dh_testdir
touch $(STAMP_DIR)/configure-stamp
build: $(STAMP_DIR)/stamp-build
$(STAMP_DIR)/stamp-build: $(patched) $(STAMP_DIR)/stamp-configure
dh_testdir
touch $(STAMP_DIR)/stamp-build
clean:
dh_testdir
rm -rf $(STAMP_DIR) $(SOURCE_DIR)
perl $(SCRIPT_DIR)/dbs_split clean
dh_clean
install:
# Nothing to do -- this is an arch independent package
dh_testdir
dh_testroot
dh_clean -k
dh_installdirs
# cd $(BUILD_TREE) && $(MAKE) install prefix=$(DEBIAN_ROOT)/usr \
# infodir=$(DEBIAN_ROOT)/usr/share/info
$(INSTALL_SCRIPT) $(BUILD_TREE)/rmagic.pl $(DEBIAN_ROOT)/usr/bin/rmagic
$(INSTALL_FILE) $(BUILD_TREE)/lang/en/*.ini $(DEBIAN_ROOT)/etc/rmagic/
sed \
-e 's/^Language = en/Language = custom/' \
-e 's/^Include =/#Include =/' \
-e 's/^Active_Column = R/Active_Column = P/' \
$(BUILD_TREE)/lang/en/rmagic.ini \
> $(DEBIAN_ROOT)/etc/rmagic/rmagic.ini
$(INSTALL_FILE) $(BUILD_TREE)/*.gif $(DEBIAN_ROOT)/usr/share/rmagic/
for i in `cd $(BUILD_TREE) && find lang -type d -mindepth 1 -maxdepth 1`; do \
$(INSTALL_DIR) $(DEBIAN_ROOT)/usr/share/rmagic/$$i; \
for j in `cd $(BUILD_TREE) && find $$i -type f -name '*.ini' -mindepth 1 -maxdepth 1`; do \
$(INSTALL_FILE) $(BUILD_TREE)/$$j $(DEBIAN_ROOT)/usr/share/rmagic/$$j; \
done; \
test -f $(DEBIAN_ROOT)/usr/share/rmagic/$$i/rmagic.ini || \
$(INSTALL_FILE) $(BUILD_TREE)/lang/en/rmagic.ini $(DEBIAN_ROOT)/usr/share/rmagic/$$i/; \
sed 's/^Include =/#Include =/' \
$(DEBIAN_ROOT)/usr/share/rmagic/$$i/rmagic.ini \
> $(DEBIAN_ROOT)/usr/share/rmagic/$$i/rmagic.ini.tmp; \
mv -f $(DEBIAN_ROOT)/usr/share/rmagic/$$i/rmagic.ini.tmp \
$(DEBIAN_ROOT)/usr/share/rmagic/$$i/rmagic.ini; \
done
ln -s /etc/rmagic $(DEBIAN_ROOT)/usr/share/rmagic/lang/custom
# FIXME!
cp -a $(BUILD_TREE)/wadg $(DEBIAN_ROOT)/usr/share/rmagic
$(INSTALL_FILE) $(BUILD_TREE)/docs/*.html $(DEBIAN_ROOT)/usr/share/doc/rmagic/html/
$(INSTALL_FILE) $(BUILD_TREE)/docs/images/*.gif $(DEBIAN_ROOT)/usr/share/doc/rmagic/html/images/
$(INSTALL_FILE) $(BUILD_TREE)/samples/*.ini $(DEBIAN_ROOT)/usr/share/doc/rmagic/examples/
$(INSTALL_FILE) $(BUILD_TREE)/samples/*.html $(DEBIAN_ROOT)/usr/share/doc/rmagic/examples/
$(INSTALL_FILE) $(BUILD_TREE)/samples/*.dat $(DEBIAN_ROOT)/usr/share/doc/rmagic/examples/
$(INSTALL_FILE) $(BUILD_TREE)/samples/images/*.gif $(DEBIAN_ROOT)/usr/share/doc/rmagic/examples/images/
$(INSTALL_FILE) $(BUILD_TREE)/samples/images/*.jpg $(DEBIAN_ROOT)/usr/share/doc/rmagic/examples/images/
binary-indep:
# Do nothing, this is arch-dependent.
binary-arch: build install
dh_testdir
dh_testroot
dh_installdocs $(BUILD_TREE)/README
dh_installcron
dh_installmanpages
dh_installdebconf
dh_installchangelogs
dh_installinfo
dh_compress
dh_fixperms
dh_installdeb
dh_perl
dh_gencontrol
dh_md5sums
dh_builddeb
binary: binary-indep binary-arch
|