Skip to content

Commit 03f1f3c

Browse files
committed
Move Debian package build recipe to Makefile
1 parent fa170eb commit 03f1f3c

File tree

4 files changed

+46
-79
lines changed

4 files changed

+46
-79
lines changed

Makefile

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
1-
.PHONY: all clean install dev release debug sanitize
1+
.PHONY: all clean install dev release debug sanitize deb debian-dirs
22

33
#########################################################################
44
# BUILD COMMON
55
#########################################################################
66

7+
VERSION ?= 1.0.0-rc10
78
PREFIX ?= /usr
89
CXXFLAGS ?= -march=native
910
CXXFLAGS += -std=c++11 -Wall -Wno-reorder -fPIC -pie \
10-
-DVERSION=$(shell cat VERSION) -Wl,-rpath=$(PREFIX)/share/e9tool/lib/
11+
-DVERSION=$(VERSION) -Wl,-rpath=$(PREFIX)/share/e9tool/lib/
1112

1213
E9PATCH_OBJS=\
1314
src/e9patch/e9CFR.o \
@@ -164,3 +165,31 @@ debug: dev
164165

165166
sanitize: CXXFLAGS += -O0 -g -fsanitize=address
166167
sanitize: dev
168+
169+
DEB := e9patch_$(VERSION)_amd64.deb
170+
deb: $(DEB)
171+
172+
$(DEB): install/debian-binary install/control.tar.gz install/data.tar.gz
173+
fakeroot ar cr $@ $^
174+
175+
install/debian-binary: debian-dirs
176+
echo 2.0 > $@
177+
178+
install/control.tar.gz: install/control/md5sums install/control/control
179+
(cd install/control;\
180+
tar cz --owner root --group root -f ../control.tar.gz .)
181+
182+
install/control/md5sums: install/data
183+
find $< -type f | xargs md5sum | sed 's#$</##' > $@
184+
185+
install/control/control: debian-binary-control.in
186+
sed 's/\bVERSION\b/$(VERSION)/' $< > $@
187+
188+
install/data.tar.gz: install/data
189+
(cd $<; tar cz --owner root --group root -f ../data.tar.gz .)
190+
191+
install/data: tool release
192+
$(MAKE) DESTDIR=install/data install
193+
194+
debian-dirs:
195+
mkdir -p install/control

VERSION

Lines changed: 0 additions & 1 deletion
This file was deleted.

debian-binary-control.in

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
Package: e9patch
2+
Version: VERSION
3+
Maintainer: Gregory J. Duck <[email protected]>
4+
Section: universe/devel
5+
Priority: optional
6+
Homepage: https://github.com/GJDuck/e9patch
7+
Architecture: amd64
8+
Depends: libc6 (>= 2.14), zlib1g (>= 1:1.2.2.3)
9+
Description: The E9Patch static binary rewriting system
10+
E9Patch is a powerful static rewriting system for stripped x86_64 Linux ELF
11+
and Windows PE binaries. E9Patch is primarily designed for robustness, and
12+
can scale to very large/complex binaries without introducing rewriting
13+
errors.
14+
.
15+
This package also includes the E9Tool frontend for E9Patch.

install.sh

Lines changed: 0 additions & 76 deletions
This file was deleted.

0 commit comments

Comments
 (0)