Skip to content

Commit

Permalink
Merge pull request #3 from linyows/debian
Browse files Browse the repository at this point in the history
Support debian package
  • Loading branch information
linyows authored Feb 20, 2017
2 parents 4940a16 + 5ff4ab7 commit d039aae
Show file tree
Hide file tree
Showing 9 changed files with 50 additions and 40 deletions.
46 changes: 30 additions & 16 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -99,34 +99,48 @@ install_cli: ## Install only cli command

dist: ## Distribute as archived source
@echo "$(INFO_COLOR)==> $(RESET)$(BOLD)Distributing$(RESET)"
rm -rf octopass-$(VERSION) octopass-$(VERSION).tar octopass-$(VERSION).tar.gz
mkdir octopass-$(VERSION)
cp $(SOURCES) octopass-$(VERSION)
tar cf octopass-$(VERSION).tar octopass-$(VERSION)
gzip -9 octopass-$(VERSION).tar
rm -rf octopass-$(VERSION)

dist_debian:
rm -rf octopass-$(VERSION) octopass-$(VERSION).tar octopass-$(VERSION).orig.tar.xz
mkdir octopass-$(VERSION)
cp $(SOURCES) octopass octopass-$(VERSION)
tar cvf octopass-$(VERSION).tar octopass-$(VERSION)
xz -v octopass-$(VERSION).tar
mv octopass-$(VERSION).tar.xz octopass-$(VERSION).orig.tar.xz
rm -rf octopass-$(VERSION)
rm -rf tmp.rhel octopass-$(VERSION).tar.gz
mkdir -p tmp.rhel/octopass-$(VERSION)
cp $(SOURCES) tmp.rhel/octopass-$(VERSION)
cd tmp.rhel && \
tar cf octopass-$(VERSION).tar octopass-$(VERSION) && \
gzip -9 octopass-$(VERSION).tar
mv tmp.rhel/octopass-$(VERSION).tar.gz .
rm -rf tmp.rhel

rpm: dist
mv octopass-$(VERSION).tar.gz /root/rpmbuild/SOURCES
spectool -g -R rpm/octopass.spec
rpmbuild -ba rpm/octopass.spec
cp /root/rpmbuild/RPMS/*/*.rpm /octopass/builds

dist_debian:
@echo "$(INFO_COLOR)==> $(RESET)$(BOLD)Distributing$(RESET)"
rm -rf tmp.debian octopass_$(VERSION).orig.tar.xz
mkdir -p tmp.debian/octopass-$(VERSION)
cp $(SOURCES) tmp.debian/octopass-$(VERSION)
cd tmp.debian && \
tar cf octopass_$(VERSION).tar octopass-$(VERSION) && \
xz -v octopass_$(VERSION).tar
mv tmp.debian/octopass_$(VERSION).tar.xz octopass_$(VERSION).orig.tar.xz
rm -rf tmp.debian

deb: dist_debian
tar xvf octopass_$(VERSION).orig.tar.xz
cd octopass-$(VERSION) && \
dh_make --single --createorig -y && \
rm -rf debian/*.ex debian/*.EX debian/README.Debian && \
cp -v /octopass/debian/* debian/ && \
debuild -uc -us
cp *.deb /octopass/builds
rm -rf octopass-$(VERSION) octopass_$(VERSION)-* octopass_$(VERSION).orig.tar.xz

clean: ## Delete tmp directory
@echo "$(INFO_COLOR)==> $(RESET)$(BOLD)Cleaning$(RESET)"
rm -rf $(TMP)

distclean: clean
rm -f *~ \#*
rm -f build/octopass*

help:
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "$(INFO_COLOR)%-30s$(RESET) %s\n", $$1, $$2}'
Expand Down
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,10 @@ Installation

Packages are provided via [packagecloud](https://packagecloud.io/linyows/octopass).

:cry: Package now has only RPM, so I am glad if someone will help me.
Available for:

- CentOS 7.x
- Ubuntu Xenial

### Building from Source

Expand Down
7 changes: 6 additions & 1 deletion debian/changelog
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
octopass (0.1.0-1) unstable; urgency=medium
octopass (0.2.0-1) xenial; urgency=medium

* Change implementation in Go to C.

-- linyows <[email protected]> Mon, 20 Feb 2017 23:00:00 +0900
octopass (0.1.0-1) xenial; urgency=medium

* Initial release.

Expand Down
3 changes: 1 addition & 2 deletions debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ Vcs-Browser: https://github.com/linyows/octopass/tree/debian
Vcs-Git: https://github.com/linyows/octopass -b debian

Package: octopass
Architecture: any
Multi-Arch: same
Architecture: amd64
Depends: ${shlibs:Depends}, ${misc:Depends}
Description: This is linux user management tool by the
organization/team on github, and authentication.
Expand Down
2 changes: 1 addition & 1 deletion debian/dirs
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
/usr/lib
/usr/bin
/usr/bin
/var/cache
3 changes: 0 additions & 3 deletions debian/lintian-overrides
Original file line number Diff line number Diff line change
@@ -1,5 +1,2 @@
# This shared library is only for NSS.
libnss-cache binary: package-name-doesnt-match-sonames libnss-cache2

octopass: arch-dependent-file-not-in-arch-specific-directory usr/bin/octopass
octopass: statically-linked-binary usr/bin/octopass
1 change: 0 additions & 1 deletion debian/rules
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ BINDIR=$(PREFIX)/bin
override_dh_auto_install:
mkdir -p $(LIBDIR) $(BINDIR) $(CONFDIR)
dh_auto_install -- LIBDIR=$(LIBDIR) PREFIX=$(PREFIX) BINDIR=$(BINDIR)
install -pm 755 octopass $(BINDIR)
install -pm 644 octopass.conf.example $(CONFDIR)
find $(DESTDIR)

Expand Down
12 changes: 6 additions & 6 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ rpm:
volumes:
- .:/octopass
command: make rpm

#deb:
# dockerfile: dockerfiles/Dockerfile.ubuntu
# build: .
# volumes:
# - .:/builds
deb:
dockerfile: dockerfiles/Dockerfile.ubuntu
build: .
volumes:
- .:/octopass
command: make deb
11 changes: 2 additions & 9 deletions dockerfiles/Dockerfile.ubuntu
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,9 @@ MAINTAINER linyows <[email protected]>

RUN apt-get -qq update && \
apt-get install -qq glibc-source gcc make libcurl4-gnutls-dev libjansson-dev \
bzip2 unzip debhelper dh-make devscripts cdbs clang-format-3.4
bzip2 unzip debhelper dh-make devscripts cdbs clang

ENV VERSION 0.1.0
ENV USER root

RUN mkdir /octopass
ADD . /octopass
WORKDIR /octopass/nss

RUN make dist_debian && tar xvf octopass_$VERSION.orig.tar.xz && cd octopass-$VERSION && \
dh_make --single --createorig -y && \
rm -rf debian/*.ex debian/*.EX && cp -v /octopass/debian/* debian/ && \
debuild -uc -us --set-envvar="LINTIAN_PROFILE=ubuntu" && cp *.deb /builds
WORKDIR /octopass

0 comments on commit d039aae

Please sign in to comment.