diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..e0d1e181c27f6eec272af70fbbb3c329b192e61f --- /dev/null +++ b/Dockerfile @@ -0,0 +1,6 @@ +FROM debian:jessie +WORKDIR /root/ +COPY patches patches +COPY build.sh build.sh +RUN ./build.sh +CMD tar c *.deb diff --git a/README.md b/README.md index d5057ac565a60892b167048afdcc2384b838fdef..af6178368aa87a67cbe4de35af7325d199322d2e 100644 --- a/README.md +++ b/README.md @@ -1 +1,12 @@ -Radsecproxy med patcher for UNINETT/eduroame +# Build script for Radsecproxy at UNINETT + +This script will generate a .deb package for Radsecproxy. + +## Usage + +Edit **build.sh** and set the desired version number for Radsecproxy. + +```bash +docker build --no-cache -t radsecproxy-debbuild . +docker run -i radsecproxy-debbuild | tar x +``` diff --git a/build.sh b/build.sh new file mode 100755 index 0000000000000000000000000000000000000000..4124ed1d636055636a4e9803696bcbd9c8d8212a --- /dev/null +++ b/build.sh @@ -0,0 +1,50 @@ +#!/bin/sh + +set -e +# set -x + +export TZ="Europe/Oslo" + +package="radsecproxy" +version="1.6.8" +now=$(date +"%a, %d %b %Y %T %z") + +here=$(pwd) + +export DEBIAN_FRONTEND=noninteractive + +cat >> /etc/apt/sources.list << EOF +deb-src http://httpredir.debian.org/debian jessie main +deb-src http://httpredir.debian.org/debian jessie-updates main +deb-src http://security.debian.org jessie/updates main +EOF + +apt-get update +apt-get -y upgrade +apt-get -y install curl debhelper dh-autoreconf dh-systemd autotools-dev libssl-dev nettle-dev docbook2x + +curl -o "${package}"_"${version}".orig.tar.gz "https://software.nordu.net/${package}/${package}-${version}.tar.gz" +tar xzf "${package}"_"${version}".orig.tar.gz + +apt-get source ${package} +tar xf "${package}"_*.debian.tar.xz -C "${package}"-"${version}/" + +cp patches/* "${package}"-"${version}"/debian/patches/ +for patch in patches/* ; do + echo ${patch##*/} +done >> "${package}"-"${version}"/debian/patches/series + +cat > changelog << EOF +radsecproxy (${version}-uninett1) unstable; urgency=medium + + * New upstream release, with uninett-specific patches + + -- Kolbjørn Barmen ${now} + +EOF +cat "${package}-${version}/debian/changelog" >> changelog +cat changelog > "${package}-${version}/debian/changelog" + +cd "${package}-${version}/" +dpkg-buildpackage +cd "${here}" diff --git a/patches/patch-aa b/patches/patch-aa index 436f60e04979150aefcb1bc7b149714c2e7c6b79..040bdaf782e0e0a38229d14139330efaa3714aea 100644 --- a/patches/patch-aa +++ b/patches/patch-aa @@ -2,11 +2,11 @@ $NetBSD$ These syslog messages occur way too often. ...and since Kolla likes to run with full debugging turned on, eliminate these so -that we don't fill the /var file system. +that we don't fill the /var/log file system. ---- radsecproxy.c.orig 2010-06-03 14:44:10.000000000 +0200 -+++ radsecproxy.c -@@ -419,7 +419,9 @@ struct request *newrqref(struct request +--- a/radsecproxy.c 2016-03-14 15:14:55.000000000 +0100 ++++ b/radsecproxy.c 2016-08-03 15:27:28.504000000 +0200 +@@ -433,7 +433,9 @@ void freerq(struct request *rq) { if (!rq) return; diff --git a/patches/patch-ab b/patches/patch-ab index e0b691a910b02ed63f5813214ed445a270b789a4..28faf472045b295d930f3864e34d1024e5771c64 100644 --- a/patches/patch-ab +++ b/patches/patch-ab @@ -2,11 +2,11 @@ $NetBSD$ These syslog messages occur way too often. ...and since Kolla likes to run with full debugging turned on, eliminate these so -that we don't fill the /var file system. +that we don't fill the /var/log file system. ---- udp.c.orig 2010-06-03 14:44:11.000000000 +0200 -+++ udp.c -@@ -308,7 +308,9 @@ void *udpserverwr(void *arg) { +--- a/udp.c 2016-03-14 15:14:55.000000000 +0100 ++++ b/udp.c 2016-08-03 15:28:31.056000000 +0200 +@@ -310,7 +310,9 @@ if (sendto(reply->udpsock, reply->replybuf, RADLEN(reply->replybuf), 0, (struct sockaddr *)&to, SOCKADDR_SIZE(to)) < 0) debug(DBG_WARN, "udpserverwr: send failed"); } diff --git a/patches/patch-ac b/patches/patch-ac index f5345d6962e3a2fb0828349a85e114ffac58163f..2ce63dfea6a1ee9c14238d361f2aa2aa50656938 100644 --- a/patches/patch-ac +++ b/patches/patch-ac @@ -2,9 +2,9 @@ $NetBSD$ Use NOTICE for requests as well ---- radsecproxy.c.orig 2010-12-23 14:01:35.000000000 +0100 -+++ radsecproxy.c -@@ -1261,12 +1261,12 @@ +--- a/radsecproxy.c 2016-08-03 15:27:28.504000000 +0200 ++++ b/radsecproxy.c 2016-08-03 15:29:01.328000000 +0200 +@@ -1284,12 +1284,12 @@ attr = radmsg_gettype(msg, RAD_Attr_User_Name); if (!attr) { @@ -19,7 +19,7 @@ Use NOTICE for requests as well free(username); } -@@ -1469,7 +1469,7 @@ +@@ -1523,7 +1523,7 @@ userascii = radattr2ascii(attr); if (!userascii) goto rmclrqexit; diff --git a/patches/patch-ad b/patches/patch-ad index b2a061a675cea0e089d890e645e7c84eab19c1e5..b0f88594dcf11990a748dddf252fd80c05f1d767 100644 --- a/patches/patch-ad +++ b/patches/patch-ad @@ -3,9 +3,9 @@ $NetBSD$ Don't overwrite LDFLAGS, only add to it. We might get flags via the build environment, but not during the configure stage. ---- Makefile.in.orig 2012-04-16 13:08:14.000000000 +0000 -+++ Makefile.in -@@ -207,7 +207,7 @@ INSTALL_DATA = @INSTALL_DATA@ +--- a/Makefile.in 2016-03-14 15:15:08.000000000 +0100 ++++ b/Makefile.in 2016-08-03 15:29:37.344000000 +0200 +@@ -310,7 +310,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@