-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
802 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
|
||
ifeq ($(PREFIX),) | ||
PREFIX := /usr | ||
endif | ||
|
||
helloworld: | ||
gcc main.c -o helloworld | ||
|
||
install: helloworld | ||
install -d $(DESTDIR)$(PREFIX)/bin/ | ||
install -D -m 0755 helloworld $(DESTDIR)$(PREFIX)/bin/ | ||
|
||
clean: | ||
-rm -f helloworld |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,39 @@ | ||
# Example-Deb-pkg | ||
Example repository for building Raspbian .deb packages | ||
|
||
based on https://blog.packagecloud.io/debian/debuild/packaging/2015/06/08/buildling-deb-packages-with-debuild/ | ||
|
||
pbuilderrc must bei copied to /root/: | ||
``` | ||
root@host % cp pbuilderrc /root/.pbuilderrc | ||
``` | ||
|
||
### Needed tools: | ||
|
||
``` | ||
aptitude install devscripts build-essential lintian pbuilder qemu-user-static qemu-system-arm debhelper | ||
``` | ||
|
||
### Create init cfg: | ||
|
||
``` | ||
export DEBFULLNAME="Max Muster" | ||
export DEBEMAIL="[email protected]" | ||
dch --create --newversion 0.0.1 --package hellodebian | ||
``` | ||
|
||
### Generate src pkg | ||
|
||
as root: | ||
``` | ||
debuild -i -us -uc -S | ||
``` | ||
|
||
### Generate deb pkg | ||
|
||
for every target arch: | ||
``` | ||
OS=raspbian DIST=buster ARCH=armhf pbuilder --create | ||
OS=debian DIST=buster ARCH=amd64 pbuilder --create | ||
``` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
hellodebian (0.0.1) UNRELEASED; urgency=medium | ||
|
||
* Initial release. | ||
|
||
-- Michael Maier <[email protected]> Thu, 11 Jun 2020 13:09:38 +0200 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
10 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
Source: hellodebian | ||
Maintainer: Michael Maier <[email protected]> | ||
Build-Depends: debhelper (>= 8.0.0) | ||
Standards-Version: 4.5.0 | ||
Section: utils | ||
|
||
Package: hellodebian | ||
Priority: extra | ||
Architecture: any | ||
Depends: ${shlibs:Depends}, ${misc:Depends} | ||
Description: a simple helloworld package | ||
Just prints "Hi", it's very useful. |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
hellodebian_0.0.1_source.buildinfo utils - |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/usr/bin/make -f | ||
%: | ||
dh $@ | ||
override_dh_auto_install: | ||
dh_auto_install -- prefix=/usr |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#include <stdio.h> | ||
int main (int argc, char *argv[]) { | ||
printf("Hi\n"); | ||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
#!/bin/sh | ||
|
||
set -e | ||
|
||
if [ "$OS" == "debian" ]; then | ||
MIRRORSITE="http://ftp.se.debian.org/debian/" | ||
COMPONENTS="main contrib non-free" | ||
DEBOOTSTRAPOPTS=("${DEBOOTSTRAPOPTS[@]}" | ||
"--keyring=/usr/share/keyrings/debian-archive-keyring.gpg") | ||
: ${DIST:="buster"} | ||
: ${ARCH:="amd64"} | ||
if [ "$DIST" == "buster" ]; then | ||
#EXTRAPACKAGES="$EXTRAPACKAGES debian-backports-keyring" | ||
OTHERMIRROR="$OTHERMIRROR | deb $MIRRORSITE buster-backports $COMPONENTS" | ||
fi | ||
elif [ "$OS" == "raspbian" ]; then | ||
MIRRORSITE="http://ftp.acc.umu.se/mirror/raspbian/raspbian/" | ||
COMPONENTS="main contrib non-free" | ||
PBUILDERSATISFYDEPENDSCMD="/usr/lib/pbuilder/pbuilder-satisfydepends-apt" | ||
DEBOOTSTRAPOPTS=("${DEBOOTSTRAPOPTS[@]}" | ||
"--keyring=/usr/share/keyrings/raspbian-archive-keyring.gpg") | ||
: ${DIST:="buster"} | ||
: ${ARCH:="armhf"} | ||
else | ||
echo "Unknown OS: $OS" | ||
exit 1 | ||
fi | ||
if [ "$DIST" == "" ]; then | ||
echo "DIST is not set" | ||
exit 1 | ||
fi | ||
|
||
NAME="$OS-$DIST-$ARCH" | ||
|
||
if [ "$ARCH" == "armel" ] && [ "$(dpkg --print-architecture)" != "armel" ]; then | ||
DEBOOTSTRAP="qemu-debootstrap" | ||
fi | ||
if [ "$ARCH" == "armhf" ] && [ "$(dpkg --print-architecture)" != "armhf" ]; then | ||
DEBOOTSTRAP="qemu-debootstrap" | ||
fi | ||
|
||
DEBOOTSTRAPOPTS=("${DEBOOTSTRAPOPTS[@]}" "--arch=$ARCH") | ||
BASETGZ="/var/cache/pbuilder/$NAME-base.tgz" | ||
DISTRIBUTION="$DIST" | ||
BUILDRESULT="/var/cache/pbuilder/$NAME/result/" | ||
APTCACHE="/var/cache/pbuilder/$NAME/aptcache/" | ||
BUILDPLACE="/var/cache/pbuilder/build" | ||
HOOKDIR="/var/cache/pbuilder/hook.d/" |