Skip to content

Commit

Permalink
Add Makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
rhatdan committed Nov 2, 2016
1 parent 308c5e3 commit 2b1f906
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 17 deletions.
27 changes: 27 additions & 0 deletions Makefile
@@ -0,0 +1,27 @@
# Installation directories.
PREFIX ?= $(DESTDIR)/usr
BINDIR ?= $(PREFIX)/bin
MANDIR ?= $(PREFIX)/share/man
UNITDIR ?= $(PREFIX)/lib/systemd/system
DSSLIBDIR ?= $(PREFIX)/lib/docker-storage-setup
SYSCONFDIR ?= $(DESTDIR)/etc/sysconfig
PROFILEDIR ?= $(DESTDIR)/etc/profile.d

.PHONY: test
test:
./tests/run-tests.sh

.PHONY: clean
clean:
-rm -rf *~ \#* .#*

.PHONY: install
install:

install -D -m 755 docker-storage-setup.sh ${BINDIR}/docker-storage-setup
install -D -m 644 docker-storage-setup.service ${UNITDIR}/docker-storage-setup.service
install -D -m 644 docker-storage-setup.conf ${DSSLIBDIR}/docker-storage-setup
install -D -m 644 docker-storage-setup-override.conf ${SYSCONFDIR}/docker-storage-setup
install -D -m 755 libdss.sh ${DSSLIBDIR}/libdss.sh
install -D -m 755 dss-child-read-write.sh ${DSSLIBDIR}/dss-child-read-write
install -D -m 644 docker-storage-setup.1 ${MANDIR}/man1/docker-storage-setup.1
18 changes: 1 addition & 17 deletions docker-storage-setup.spec
Expand Up @@ -7,12 +7,6 @@ Summary: A simple service to setup docker storage devices

License: ASL 2.0
URL: http://github.com/a13m/docker-storage-setup/
Source0: docker-storage-setup.sh
Source1: docker-storage-setup.service
Source2: docker-storage-setup.conf
Source3: docker-storage-setup-override.conf
Source4: libdss.sh
Source5: dss-child-read-write.sh

BuildRequires: pkgconfig(systemd)

Expand All @@ -30,17 +24,7 @@ as the root logical volume and partition table.
%build

%install
install -d %{buildroot}%{_bindir}
install -p -m 755 %{SOURCE0} %{buildroot}%{_bindir}/docker-storage-setup
install -d %{buildroot}%{_unitdir}
install -p -m 644 %{SOURCE1} %{buildroot}%{_unitdir}
install -d %{buildroot}/%{dsslibdir}
install -p -m 644 %{SOURCE2} %{buildroot}/%{dsslibdir}/docker-storage-setup
install -d %{buildroot}%{_sysconfdir}/sysconfig/
install -p -m 644 %{SOURCE3} %{buildroot}%{_sysconfdir}/sysconfig/docker-storage-setup
install -d %{buildroot}/%{dsslibdir}
install -p -m 755 %{SOURCE4} %{buildroot}/%{dsslibdir}/libdss.sh
install -p -m 755 %{SOURCE5} %{buildroot}/%{dsslibdir}/dss-child-read-write
%make_install

%post
%systemd_post %{name}.service
Expand Down

0 comments on commit 2b1f906

Please sign in to comment.