Setup deb & rpm packaging

This commit is contained in:
Yann Weber 2023-04-07 10:36:23 +02:00
commit 8a1388b9f7
8 changed files with 138 additions and 5 deletions

View file

@ -2,6 +2,7 @@ SUBDIRS = . src docs
EXTRA_DIST = regen.sh
TO_LOCAL_CLEAN=
ALL_CHECKS=
LINT=
if CHECK
@ -19,7 +20,7 @@ if HAVE_LCOV
LCOV_INFO=lcov.info
LCOV_HTML=lcov_html
TO_LOCAL_CLEAN = $(LCOV_INFO) $(LCOV_HTML)
TO_LOCAL_CLEAN += $(LCOV_INFO) $(LCOV_HTML)
$(LCOV_INFO): $(CHECK_STAMP)
$(LCOV) --base-directory $(top_builddir)/src/ --capture --directory $(top_builddir)/src/ --output-file $@
@ -27,8 +28,6 @@ $(LCOV_INFO): $(CHECK_STAMP)
$(LCOV_HTML): $(LCOV_INFO)
genhtml $< --output-directory $@
clean-local:
-rm -rf $(TO_LOCAL_CLEAN)
endif # HAVE_LCOV
@ -53,3 +52,52 @@ lint: $(LINT)
doxygen:
$(MAKE) -C docs
DEB_BUILD=$(PACKAGE)-$(VERSION)
DEB_PREF=$(PACKAGE)_$(VERSION)-1_amd64
DEB_PKG=$(DEB_PREF).deb
DEB_FOLDER=$(DEB_BUILD)/debian
RPM_BUILD=rpm_build
PKGV=$(PACKAGE)-$(VERSION).tar.gz
TO_LOCAL_CLEAN+=$(PACKAGE)_$(VERSION)-1.debian.tar.xz $(PACKAGE)_$(VERSION)-1.dsc\
$(PACKAGE)_$(VERSION).orig.tar.gz \
$(PACKAGE)-dbgsym_$(VERSION)-1_amd64.deb \
$(DEB_PREF).buildinfo \
$(DEB_PREF).changes \
$(DEB_PREF).deb \
$(PACKAGE)_$(VERSION).tar.gz \
$(PACKAGE)-$(VERSION) \
$(RPM_BUILD) \
*.rpm
$(PKGV): dist
$(DEB_BUILD): $(PACKAGE)-$(VERSION).tar.gz
tar -xf $<
$(DEB_FOLDER): deb_folder $(DEB_BUILD)
cp -R $< $@
$(DEB_PKG): $(PKGV) $(DEB_BUILD) $(DEB_FOLDER)
cd $(DEB_BUILD);\
dh_make -a -y -s -f ../$(PACKAGE)-$(VERSION).tar.gz;\
rm debian/*.ex debian/*.EX debian/README.Debian debian/README.source ;\
dpkg-buildpackage $(shell [ -z ${DEB_SIGN_KEYID} ] && echo "-us -uc" || echo "--sign-key='${DEB_SIGN_KEYID}'");
deb: $(DEB_PKG)
rpm: $(DEB_PKG)
mkdir -p $(RPM_BUILD);\
cd $(RPM_BUILD); \
fakeroot alien -k --to-rpm ../$(DEB_PKG);\
mv *.rpm ../;
release: deb rpm
clean-local:
-rm -rf $(TO_LOCAL_CLEAN)

View file

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

5
deb_folder/changelog Normal file
View file

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

16
deb_folder/control Normal file
View file

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

38
deb_folder/copyright Normal file
View file

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

25
deb_folder/rules Executable file
View file

@ -0,0 +1,25 @@
#!/usr/bin/make -f
# See debhelper(7) (uncomment to enable)
# output every command that modifies files on the build system.
#export DH_VERBOSE = 1
# see FEATURE AREAS in dpkg-buildflags(1)
#export DEB_BUILD_MAINT_OPTIONS = hardening=+all
# see ENVIRONMENT in dpkg-buildflags(1)
# package maintainers to append CFLAGS
#export DEB_CFLAGS_MAINT_APPEND = -Wall -pedantic
# package maintainers to append LDFLAGS
#export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed
%:
dh $@
# dh_make generated override targets
# This is example for Cmake (See https://bugs.debian.org/641051 )
#override_dh_auto_configure:
# dh_auto_configure -- \
# -DCMAKE_LIBRARY_PATH=$(DEB_HOST_MULTIARCH)

View file

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

View file

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