Skip to content

Commit

Permalink
Dockerfile, RPM upload to package cloud
Browse files Browse the repository at this point in the history
  • Loading branch information
William GARCIA committed Jan 30, 2016
1 parent 48056ac commit 0682a5a
Show file tree
Hide file tree
Showing 6 changed files with 58 additions and 53 deletions.
4 changes: 1 addition & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
dist
dpkg*
.vagrant
*.rpm
13 changes: 13 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
FROM centos:6

MAINTAINER William GARCIA <[email protected]>

RUN yum -y update && yum -y install xz rpm-build yum-utils wget tar gcc ncurses-devel

ADD ./entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh

WORKDIR /root
VOLUME /root

ENTRYPOINT [ "/entrypoint.sh" ]
25 changes: 0 additions & 25 deletions Makefile

This file was deleted.

23 changes: 12 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,20 @@

This project provides the start-stop-daemon utility.

## Build

```
vagrant up
```
## Installation

The RPM file can be found in `[/vagrant/]dist/RPMS/x86_64/start-stop-daemon-1.18.2-1.el6.x86_64.rpm`

## Dev
See the [Packagecloud instructions](https://packagecloud.io/willgarcia/start-stop-daemon/install) to setup the RPM repository in your system

```bash
$ yum install start-stop-daemon
```
vagrant ssh
cd /vagrant
make install
make

## Build

```bash
$ docker build --tag=start-stop-daemon .
$ docker run --rm -v `pwd`:"/root/build" start-stop-daemon
```

The RPM file can be found in `./start-stop-daemon-1.18.2-1.el6.x86_64.rpm`
14 changes: 0 additions & 14 deletions Vagrantfile

This file was deleted.

32 changes: 32 additions & 0 deletions entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#!/bin/bash

set -o xtrace
set -o errexit
set -o pipefail

readonly NAME=start-stop-daemon
readonly VERSION=$(grep Version: "/root/build/$NAME.spec" | tr -s " "| cut -d " " -f 2)
readonly PKG_SOURCE="http://http.debian.net/debian/pool/main/d/dpkg/dpkg_$VERSION.tar.xz"

cd /root

wget $PKG_SOURCE
tar -xf dpkg_$VERSION.tar.xz
tar -czf dpkg_$VERSION.tar.gz dpkg-$VERSION/
mkdir -p dist/{BUILD,RPMS,SPECS,SOURCES,SRPMS,install}
mv dpkg_$VERSION.tar.gz dist/SOURCES
cp /root/build/start-stop-daemon.spec /root/

cd /root/build/

chown -R `stat -c "%u:%g" .` .
yum-builddep -y -t start-stop-daemon.spec
ls -al /root/

rpmbuild -ba \
--define "_topdir /root/dist" \
--define "buildroot /root/dist/BUILDROOT" \
--clean \
/root/start-stop-daemon.spec

cp /root/dist/RPMS/x86_64/* .

0 comments on commit 0682a5a

Please sign in to comment.