Browse Source

Setup deb & rpm packaging

Yann Weber 1 year ago
parent
commit
8a1388b9f7
8 changed files with 138 additions and 5 deletions
  1. 51
    3
      Makefile.am
  2. 1
    0
      deb_folder/asmsh-docs.docs
  3. 5
    0
      deb_folder/changelog
  4. 16
    0
      deb_folder/control
  5. 38
    0
      deb_folder/copyright
  6. 25
    0
      deb_folder/rules
  7. 1
    1
      src/Makefile.am
  8. 1
    1
      tests/samples/Makefile.am

+ 51
- 3
Makefile.am View File

@@ -2,6 +2,7 @@ SUBDIRS = . src docs
2 2
 
3 3
 EXTRA_DIST = regen.sh
4 4
 
5
+TO_LOCAL_CLEAN=
5 6
 ALL_CHECKS=
6 7
 LINT=
7 8
 if CHECK
@@ -19,7 +20,7 @@ if HAVE_LCOV
19 20
 LCOV_INFO=lcov.info
20 21
 LCOV_HTML=lcov_html
21 22
 
22
-TO_LOCAL_CLEAN = $(LCOV_INFO) $(LCOV_HTML)
23
+TO_LOCAL_CLEAN += $(LCOV_INFO) $(LCOV_HTML)
23 24
 
24 25
 $(LCOV_INFO): $(CHECK_STAMP)
25 26
 	$(LCOV) --base-directory $(top_builddir)/src/ --capture --directory $(top_builddir)/src/ --output-file $@
@@ -27,8 +28,6 @@ $(LCOV_INFO): $(CHECK_STAMP)
27 28
 $(LCOV_HTML): $(LCOV_INFO)
28 29
 	genhtml $< --output-directory $@
29 30
 
30
-clean-local:
31
-	-rm -rf $(TO_LOCAL_CLEAN)
32 31
 endif # HAVE_LCOV
33 32
 
34 33
 
@@ -53,3 +52,52 @@ lint: $(LINT)
53 52
 
54 53
 doxygen:
55 54
 	$(MAKE) -C docs
55
+
56
+
57
+
58
+DEB_BUILD=$(PACKAGE)-$(VERSION)
59
+DEB_PREF=$(PACKAGE)_$(VERSION)-1_amd64
60
+DEB_PKG=$(DEB_PREF).deb
61
+DEB_FOLDER=$(DEB_BUILD)/debian
62
+RPM_BUILD=rpm_build
63
+PKGV=$(PACKAGE)-$(VERSION).tar.gz
64
+
65
+TO_LOCAL_CLEAN+=$(PACKAGE)_$(VERSION)-1.debian.tar.xz $(PACKAGE)_$(VERSION)-1.dsc\
66
+		$(PACKAGE)_$(VERSION).orig.tar.gz \
67
+		$(PACKAGE)-dbgsym_$(VERSION)-1_amd64.deb \
68
+		$(DEB_PREF).buildinfo \
69
+		$(DEB_PREF).changes \
70
+		$(DEB_PREF).deb \
71
+		$(PACKAGE)_$(VERSION).tar.gz \
72
+		$(PACKAGE)-$(VERSION) \
73
+		$(RPM_BUILD) \
74
+		*.rpm
75
+
76
+$(PKGV): dist
77
+
78
+
79
+$(DEB_BUILD): $(PACKAGE)-$(VERSION).tar.gz
80
+	tar -xf $<
81
+	
82
+$(DEB_FOLDER): deb_folder $(DEB_BUILD)
83
+	cp -R $< $@
84
+
85
+
86
+$(DEB_PKG): $(PKGV) $(DEB_BUILD) $(DEB_FOLDER)
87
+	cd $(DEB_BUILD);\
88
+		dh_make -a -y -s -f ../$(PACKAGE)-$(VERSION).tar.gz;\
89
+		rm debian/*.ex debian/*.EX debian/README.Debian debian/README.source  ;\
90
+		dpkg-buildpackage $(shell [ -z ${DEB_SIGN_KEYID} ] && echo "-us -uc" || echo "--sign-key='${DEB_SIGN_KEYID}'");
91
+
92
+deb: $(DEB_PKG)
93
+
94
+rpm: $(DEB_PKG)
95
+	mkdir -p $(RPM_BUILD);\
96
+	cd $(RPM_BUILD); \
97
+	fakeroot alien -k --to-rpm ../$(DEB_PKG);\
98
+	mv *.rpm ../;
99
+
100
+release: deb rpm
101
+
102
+clean-local:
103
+	-rm -rf $(TO_LOCAL_CLEAN)

+ 1
- 0
deb_folder/asmsh-docs.docs View File

@@ -0,0 +1 @@
1
+../docs/man/asmsh.1

+ 5
- 0
deb_folder/changelog View File

@@ -0,0 +1,5 @@
1
+asmsh (0.0-dev-1) unstable; urgency=medium
2
+
3
+  * Initial release
4
+
5
+ -- Yann Weber <asmsh@yannweb.net>  Thu, 06 Apr 2023 09:24:01 +0200

+ 16
- 0
deb_folder/control View File

@@ -0,0 +1,16 @@
1
+Source: asmsh
2
+Section: shells
3
+Priority: optional
4
+Maintainer: Yann Weber <asmsh@yannweb.net>
5
+Build-Depends: debhelper-compat (= 13), autotools-dev, check, lcov, doxygen, libreadline-dev
6
+Standards-Version: 4.5.1
7
+Homepage: https://git.yannweb.net/yannweb/asmsh/
8
+Vcs-Git: https://git.yannweb.net/yannweb/asmsh.git
9
+Rules-Requires-Root: no
10
+
11
+Package: asmsh
12
+Architecture: any
13
+Depends: ${shlibs:Depends}, ${misc:Depends}
14
+Description: asmsh : A shell that runs assembly
15
+ asmsh is a shell that allows to run x86_64
16
+ assembly instructions in a traced sub-process

+ 38
- 0
deb_folder/copyright View File

@@ -0,0 +1,38 @@
1
+Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
2
+Upstream-Name: asmsh
3
+Upstream-Contact: Yann Weber <asmsh@yannweb.net>
4
+Source: https://git.yannweb.net/yannweb/asmsh
5
+
6
+Files: *
7
+Copyright: 2023 Yann Weber <asmsh@yannweb.net>
8
+License: GPL-3.0+
9
+
10
+Files: debian/*
11
+Copyright: 2023 Yann Weber <asmsh@yannweb.net>
12
+License: GPL-3.0+
13
+
14
+License: GPL-3.0+
15
+ This program is free software: you can redistribute it and/or modify
16
+ it under the terms of the GNU General Public License as published by
17
+ the Free Software Foundation, either version 3 of the License, or
18
+ any later version.
19
+ .
20
+ This package is distributed in the hope that it will be useful,
21
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
22
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
23
+ GNU General Public License for more details.
24
+ .
25
+ You should have received a copy of the GNU General Public License
26
+ along with this program. If not, see <https://www.gnu.org/licenses/>.
27
+ .
28
+ On Debian systems, the complete text of the GNU General
29
+ Public License version 3 can be found in "/usr/share/common-licenses/GPL-3".
30
+
31
+# Please also look if there are files or directories which have a
32
+# different copyright/license attached and list them here.
33
+# Please avoid picking licenses with terms that are more restrictive than the
34
+# packaged work, as it may make Debian's contributions unacceptable upstream.
35
+#
36
+# If you need, there are some extra license texts available in two places:
37
+#   /usr/share/debhelper/dh_make/licenses/
38
+#   /usr/share/common-licenses/

+ 25
- 0
deb_folder/rules View File

@@ -0,0 +1,25 @@
1
+#!/usr/bin/make -f
2
+# See debhelper(7) (uncomment to enable)
3
+# output every command that modifies files on the build system.
4
+#export DH_VERBOSE = 1
5
+
6
+
7
+# see FEATURE AREAS in dpkg-buildflags(1)
8
+#export DEB_BUILD_MAINT_OPTIONS = hardening=+all
9
+
10
+# see ENVIRONMENT in dpkg-buildflags(1)
11
+# package maintainers to append CFLAGS
12
+#export DEB_CFLAGS_MAINT_APPEND  = -Wall -pedantic
13
+# package maintainers to append LDFLAGS
14
+#export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed
15
+
16
+
17
+%:
18
+	dh $@
19
+
20
+
21
+# dh_make generated override targets
22
+# This is example for Cmake (See https://bugs.debian.org/641051 )
23
+#override_dh_auto_configure:
24
+#	dh_auto_configure -- \
25
+#	-DCMAKE_LIBRARY_PATH=$(DEB_HOST_MULTIARCH)

+ 1
- 1
src/Makefile.am View File

@@ -1,4 +1,4 @@
1
-bin_PROGRAMS = asmsh child
1
+bin_PROGRAMS = asmsh
2 2
 
3 3
 noinst_PROGRAMS = child
4 4
 noinst_LIBRARIES= libcheck_asmsh.a

+ 1
- 1
tests/samples/Makefile.am View File

@@ -1,5 +1,5 @@
1 1
 if CHECK
2
-bin_PROGRAMS = asm_env_stamps
2
+noinst_PROGRAMS = asm_env_stamps
3 3
 
4 4
 EXTRA_DIST=procfs_pid_maps procfs_pid_maps_sm sample.history
5 5
 

Loading…
Cancel
Save