Skip to content

Commit fa5bcc2

Browse files
committed
Move Debian package build recipe to Makefile
1 parent 840358a commit fa5bcc2

File tree

4 files changed

+48
-78
lines changed

4 files changed

+48
-78
lines changed

Makefile

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,11 @@
22
# BUILD COMMON
33
#########################################################################
44

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

1011
E9PATCH_OBJS=\
1112
src/e9patch/e9CFR.o \
@@ -181,3 +182,34 @@ tool.sanitize: $(E9TOOL_OBJS) $(E9TOOL_LIBS)
181182
$(CXX) $(CXXFLAGS) $(E9TOOL_OBJS) $(E9TOOL_LIBS) -o e9tool \
182183
$(E9TOOL_LDFLAGS)
183184

185+
DEB := e9patch_$(VERSION)_amd64.deb
186+
deb: $(DEB)
187+
188+
$(DEB): install/debian-binary install/control.tar.gz install/data.tar.gz
189+
fakeroot ar cr $@ $^
190+
191+
install/debian-binary: debian-dirs
192+
echo 2.0 > $@
193+
194+
install/control.tar.gz: install/control/md5sums install/control/control
195+
(cd install/control;\
196+
tar cz --owner root --group root -f ../control.tar.gz .)
197+
198+
install/control/md5sums: install/data
199+
find $< -type f | xargs md5sum | sed 's#$</##' > $@
200+
201+
install/control/control: debian-binary-control.in
202+
sed 's/\bVERSION\b/$(VERSION)/' $< > $@
203+
204+
install/data.tar.gz: install/data
205+
(cd $<; tar cz --owner root --group root -f ../data.tar.gz .)
206+
207+
install/data: DESTDIR := install/data
208+
install/data: tool release install
209+
210+
debian-dirs:
211+
mkdir -p install/control
212+
213+
.PHONY: all clean install\
214+
release debug sanitize tool tool.debug tool.sanitize\
215+
deb debian-dirs

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)