Skip to content

Commit

Permalink
inital ci
Browse files Browse the repository at this point in the history
  • Loading branch information
species committed Sep 7, 2020
1 parent e99a961 commit f0712b9
Show file tree
Hide file tree
Showing 10 changed files with 802 additions and 0 deletions.
14 changes: 14 additions & 0 deletions Makefile
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
37 changes: 37 additions & 0 deletions README.md
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
```

5 changes: 5 additions & 0 deletions debian/changelog
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
1 change: 1 addition & 0 deletions debian/compat
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
10
12 changes: 12 additions & 0 deletions debian/control
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.
674 changes: 674 additions & 0 deletions debian/copyright

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions debian/files
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
hellodebian_0.0.1_source.buildinfo utils -
5 changes: 5 additions & 0 deletions debian/rules
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
5 changes: 5 additions & 0 deletions main.c
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;
}
48 changes: 48 additions & 0 deletions pbuilderrc
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/"

0 comments on commit f0712b9

Please sign in to comment.