Browse Source

Initial skeleton

master
Konrad Beckmann 1 year ago
commit
11104d2491
6 changed files with 92 additions and 0 deletions
  1. +29
    -0
      Dockerfile
  2. +41
    -0
      Makefile
  3. +7
    -0
      debian/build
  4. +1
    -0
      debian/compat
  5. +10
    -0
      debian/control
  6. +4
    -0
      debian/rules

+ 29
- 0
Dockerfile View File

@@ -0,0 +1,29 @@
FROM ubuntu

MAINTAINER Konrad Beckmann <konrad.beckmann@gmail.com>

RUN apt-get update
RUN apt-get upgrade -y
RUN apt-get install -y ca-certificates apt-transport-https curl dpkg-dev pbuilder fakeroot debhelper

RUN useradd -ms /bin/bash docker
RUN mkdir -p /opt/build/gitea/
COPY . /opt/build/gitea
WORKDIR /opt/build/gitea

# Build the backend
RUN /usr/lib/pbuilder/pbuilder-satisfydepends-classic

RUN chown -R docker:docker /opt/build/
USER docker

ENV DEBFULLNAME="Xil Builder"
ENV DEBEMAIL="dockerbuilder@xil.se"

RUN dch --local "+$(date +%Y%m%d.%H%M%S)" "xil-docker-build" && \
dch --distribution "xenial" --force-distribution -r Release && \
dpkg-buildpackage && \
mkdir /opt/build/debian_out && \
cp /opt/build/*.deb /opt/build/debian_out && \
cp /opt/build/*.changes /opt/build/debian_out && \
cp /opt/build/*.dsc /opt/build/debian_out@

+ 41
- 0
Makefile View File

@@ -0,0 +1,41 @@
VERSION:=1.10.1
WORKDIR:=gitea
DEB_OUTDIR:=debian_out
BINFILE:=gitea
DIRNAME:=$(shell dirname "$0")
V:=@


all: $(WORKDIR)/$(BINFILE)

$(WORKDIR)/$(BINFILE):
$(V)mkdir -p $(WORKDIR)
$(V)curl \
-L \
https://github.com/go-gitea/gitea/releases/download/v$(VERSION)/gitea-$(VERSION)-linux-amd64 \
-o $(WORKDIR)/$(BINFILE)

install:
$(V)mkdir -p $(DESTDIR)/usr/bin
$(V)install -D -m 0755 $(WORKDIR)/$(BINFILE) $(DESTDIR)/usr/bin/$(BINFILE)

debian/changelog:
echo "gitea ($(VERSION)) xenial; urgency=medium" > debian/changelog
echo "" >> debian/changelog
echo " * Gitea version $(VERSION)" >> debian/changelog
echo "" >> debian/changelog
echo "-- Xil Builder <dockerbuilder@xil.se> `LANG=C date -R`" >> debian/changelog
echo "" >> debian/changelog
echo "" >> debian/changelog
.PHONY: debian/changelog

dockerdebbuild: debian/changelog
docker build -f Dockerfile --tag build/gitea_deb $(DIRNAME)

DOCKER_ID=$$(docker create build/gitea_deb); \
docker cp $$DOCKER_ID:/opt/build/$(DEB_OUTDIR) $(DIRNAME) && \
docker rm -v $$DOCKER_ID

clean:
$(V)rm -rf $(WORKDIR) $(DEB_OUTDIR)


+ 7
- 0
debian/build View File

@@ -0,0 +1,7 @@
build() {
make
}

package() {
make BINDIR="/usr/bin/" DESTDIR="$pkgdir" install
}

+ 1
- 0
debian/compat View File

@@ -0,0 +1 @@
9

+ 10
- 0
debian/control View File

@@ -0,0 +1,10 @@
Source: gitea
Section: main
Priority: extra
Maintainer: Konrad Beckmann <konrad.beckmann@gmail.com>
Build-Depends: curl

Package: gitea
Architecture: all
Description: Gitea xil packaged
Depends:

+ 4
- 0
debian/rules View File

@@ -0,0 +1,4 @@
#!/usr/bin/make -f
%:
dh $@


Loading…
Cancel
Save