Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add the manifest to build sys-apps/dhcpcd. #77

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 55 additions & 0 deletions sys-apps/dhcpcd/dhcpcd.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
#!/usr/bin/env python3.6
# -*- coding: utf-8 -*-

import stdlib
from stdlib.template.configure import configure
from stdlib.split.drain_all import drain_all_with_doc
from stdlib.template.make import make
from stdlib.template import autotools
from stdlib.manifest import manifest


@manifest(
name='dhcpcd',
category='sys-apps',
description='''
A DHCP client daemon compliant with RFC2131.
''',
tags=['net', 'network', 'dhcp' 'rfc2131'],
maintainer='[email protected]',
licenses=[stdlib.license.License.BSD],
upstream_url='https://roy.marples.name/projects/dhcpcd/',
kind=stdlib.kind.Kind.EFFECTIVE,
versions_data=[
{
'semver': '8.0.3',
'fetch': [{
'url': 'https://roy.marples.name/downloads/dhcpcd/dhcpcd-8.0.3.tar.xz',
'sha256': '9674971fcd5acd5a3401a0ad8eba7f0b816fec9abb4a2520332b4d8dae068f1d',
}, {
'file': './dhcpcd.service',
}
],
},
],
build_dependencies=[
'sys-apps/systemd-dev',
]
)
def build(build):
packages = autotools.build(
configure=lambda: configure(
'--disable-static',
'--without-static',
),
install=lambda: make('install'),
split=drain_all_with_doc,
)

# Drain the systemd daemon
packages['sys-apps/dhcpcd'].drain_build_cache('dhcpcd.service', 'usr/lib64/systemd/system/')

# Start the daemon when the dhcpcd is installed
packages['sys-apps/dhcpcd'].load_instructions('./instructions.sh')

return packages
12 changes: 12 additions & 0 deletions sys-apps/dhcpcd/dhcpcd.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[Unit]
Description=Lightweight DHCP client daemon
Wants=network.target
Before=network.target network-online.target

[Service]
Type=forking
ExecStart=/bin/dhcpcd -q
PIDFile=/run/dhcpcd.pid

[Install]
WantedBy=multi-user.target
22 changes: 22 additions & 0 deletions sys-apps/dhcpcd/instructions.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/usr/bin/env sh

before_install() {
:
}
Comment on lines +3 to +5
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Those are not needed now :p


after_install() {
systemctl enable dhcpcd

if [[ $(pidof "systemd") ]]; then
systemctl daemon-reload
systemctl start dhcpcd
fi
}

before_remove() {
:
}

after_remove() {
:
}