Skip to content

Commit

Permalink
Initial import
Browse files Browse the repository at this point in the history
  • Loading branch information
William GARCIA committed Dec 1, 2015
1 parent 37947bd commit 48056ac
Show file tree
Hide file tree
Showing 6 changed files with 135 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
dist
dpkg*
.vagrant
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License (MIT)

Copyright (c) 2015 William Garcia

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
25 changes: 25 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
BASE := start-stop-daemon
NAME := $(BASE)
VERSION := $(shell grep Version: $(NAME).spec | tr -s " "| cut -d " " -f 2)
PKG_SOURCE := http://http.debian.net/debian/pool/main/d/dpkg/dpkg_$(VERSION).tar.xz

default:
yum-builddep -y -t start-stop-daemon.spec
rpmbuild -ba \
--define "_topdir $(PWD)/dist" \
--define "buildroot $(PWD)/dist/BUILDROOT" \
--clean \
$(NAME).spec

clean:
rm -rf dpkg* dist

install: clean
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


.PHONY: install clean default
21 changes: 20 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,20 @@
# start-stop-daemon
# buildrpm start-stop-daemon

This project provides the start-stop-daemon utility.

## Build

```
vagrant up
```

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

## Dev

```
vagrant ssh
cd /vagrant
make install
make
```
14 changes: 14 additions & 0 deletions Vagrantfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# -*- mode: ruby -*-
# vi: set ft=ruby :

Vagrant.configure(2) do |config|
config.vm.box = "chef/centos-6.5"
config.ssh.username="root"
config.ssh.username="vagrant"
config.vm.provision "shell", inline: <<-SHELL
sudo yum install -y install xz rpm-build yum-utils wget tar
cd /vagrant
make install
make
SHELL
end
52 changes: 52 additions & 0 deletions start-stop-daemon.spec
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
%define debug_package %{nil}

Name: start-stop-daemon
Version: 1.18.2
Release: 1%{?dist}
Summary: Start and stop system daemon programs
Group: System Environment/Daemons
License: GPL2
Source: dpkg_%{version}.tar.gz
Prefix: %{_prefix}
Packager: William Garcia
BuildRequires: tar
BuildRequires: make
BuildRequires: gcc
BuildRequires: ncurses-devel
BuildRequires: ncurses

%description
start-stop-daemon is used to control the creation and termination of
system-level processes. Using one of the matching options,
start-stop-daemon can be configured to find existing instances of a
running process.

%prep
%setup -q -n dpkg-%{version}

%build
./configure
make -C lib/compat
make -C utils

%install
rm -rf $RPM_BUILD_ROOT

%{__mkdir} -p "%{buildroot}/%{_prefix}/share/man/man8"
%{__cp} -aR "man/start-stop-daemon.8" "%{buildroot}/%{_prefix}/share/man/man8/"

%{__mkdir} -p "%{buildroot}/%{_sbindir}"
%{__cp} -aR "utils/start-stop-daemon" "%{buildroot}/%{_sbindir}/start-stop-daemon"

%clean
rm -rf $RPM_BUILD_ROOT

%files
%defattr(-,root,root)
%{_prefix}/share/man/man8/start-stop-daemon.8.gz
%defattr(755,root,root)
%{_sbindir}/start-stop-daemon

%changelog
* Tue Aug 19 2015 William Garcia <[email protected]>
- Initial version

0 comments on commit 48056ac

Please sign in to comment.