Skip to content

Commit c48f3a4

Browse files
committed
Move Debian package build recipe to Makefile
1 parent a6d900b commit c48f3a4

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,14 +1,15 @@
1-
.PHONY: all clean install dev release debug sanitize
1+
.PHONY: all clean install dev release debug sanitize deb debian-dirs
22
.SECONDEXPANSION:
33

44
#########################################################################
55
# BUILD COMMON
66
#########################################################################
77

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

1314
E9PATCH_OBJS=\
1415
src/e9patch/e9CFR.o \
@@ -165,3 +166,31 @@ debug: dev
165166

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