Skip to content

Commit

Permalink
create pkg
Browse files Browse the repository at this point in the history
  • Loading branch information
UriHerrera committed Jun 5, 2024
1 parent 04f04a2 commit 9bdeb91
Show file tree
Hide file tree
Showing 18 changed files with 311 additions and 2 deletions.
26 changes: 26 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---
name: 🐞 Bug report
about: Create a report to help us improve

---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Desktop (please complete the following information):**
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]
42 changes: 42 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
---
name: "🚀 Feature request"
about: Suggest an idea for improving this software
title: ''
labels: 'type:Enhancement'
assignees: ''

---

### Is your proposal related to a problem?

<!--
Provide a clear and concise description of what the problem is.
For example, "I'm always frustrated when..."
-->

(Write your answer here.)

### Describe the solution you'd like

<!--
Provide a clear and concise description of what you want to happen.
-->

(Describe your proposed solution here.)

### Describe alternatives you've considered

<!--
Let us know about other solutions you've tried or researched.
-->

(Write your answer here.)

### Additional context

<!--
Is there anything else you can add about the proposal?
You might want to link to related issues here, if you haven't already.
-->

(Write your answer here.)
28 changes: 28 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Build and push packages to PackageCloud.

on:
push:
branches:
- 'main'
paths-ignore:
- 'README.md'

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Install dependencies.
run: |
sudo gem install package_cloud
- name: Build.
run: |
sudo ./gh-build.sh
- name: Push package.
env:
PACKAGECLOUD_TOKEN: ${{ secrets.PACKAGECLOUD_TOKEN }}
run: |
package_cloud push nitrux/testing/debian/trixie $(pwd)/*.deb
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Compiled source #
###################
*.directory
*.DS_Store
*.bak
/.project
*.db
*.qmlc
28 changes: 28 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
BSD 3-Clause License

Copyright (c) 2024, Nitrux

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.

3. Neither the name of the copyright holder nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
10 changes: 8 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,8 @@
# rsyslog-openrc

# rsyslog for OpenRC

Service files to use rsyslog with Nitrux.

# Issues
If you find problems with the contents of this repository please create an issue.

©2024 Nitrux Latinoamericana S.C.
5 changes: 5 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
rsyslog-openrc (0.0.1) nitrux; urgency=medium

* Create package.

-- Uri Herrera <[email protected]> Tue, 04 Jun 2024 23:17:00 -0500
1 change: 1 addition & 0 deletions debian/compat
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
9
17 changes: 17 additions & 0 deletions debian/control
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
Source: rsyslog-openrc
Section: misc
Priority: important
Maintainer: Uri Herrera <[email protected]>
Build-Depends: debhelper (>=9)
Standards-Version: 3.9.6
Homepage: http://nxos.org


Package: rsyslog-openrc
Architecture: all
Depends: ${shlibs:Depends}, ${misc:Depends}, openrc, rsyslog
Conflicts: systemd, systemd-sysv
Description: Package to add rsyslog configuration for OpenRC.
This package will add the boot scripts to use rsyslog
with OpenRC in Nitrux.

29 changes: 29 additions & 0 deletions debian/copyright
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: rsyslog-openrc
Source: https://github.com/Nitrux/rsyslog-openrc.git

Files: *
Copyright: 2022 Uri Herrera <[email protected]>
License: GPL-3.0+

Files: debian/*
Copyright: 2022 Uri Herrera <[email protected]>
License: GPL-3.0+

License: GPL-3.0+
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
.
This package is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
.
On Debian systems, the complete text of the GNU General
Public License version 3 can be found in "/usr/share/common-licenses/GPL-3".

1 change: 1 addition & 0 deletions debian/install
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
etc /
9 changes: 9 additions & 0 deletions debian/postinst
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/usr/bin/env bash

# -- Add service to runlevel.

rc-update add rsyslog-openrc default

# -- Update services list.

rc-update -u
3 changes: 3 additions & 0 deletions debian/postrm
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash

exit 0
3 changes: 3 additions & 0 deletions debian/preinst
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#! /bin/bash

exit 0
5 changes: 5 additions & 0 deletions debian/rules
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/make -f


%:
dh $@
1 change: 1 addition & 0 deletions debian/source/format
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.0 (quilt)
80 changes: 80 additions & 0 deletions etc/init.d/rsyslog-openrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
#!/sbin/openrc-run

description="Rsyslog is an enhanced multi-threaded syslogd"
description_start="Starting enhanced syslogd"
description_stop="Stopping enhanced syslogd"

DAEMON=/usr/sbin/rsyslogd
PIDFILE=/run/rsyslogd.pid
RSYSLOGD_OPTIONS=""

depend() {
need mountall
after bootmisc
use logger
}

start_pre() {
# Exit if the daemon is not installed
if [ ! -x "${DAEMON}" ]; then
eerror "Daemon ${DAEMON} not installed or not executable"
return 1
fi

# Read configuration variable file if it is present
if [ -r /etc/default/rsyslog ]; then
. "/etc/default/rsyslog"
else
ewarn "Configuration file /etc/default/rsyslog not found"
fi
}

start() {
ebegin "${description_start}"
create_xconsole
start-stop-daemon --start --quiet --pidfile ${PIDFILE} --exec ${DAEMON} -- ${RSYSLOGD_OPTIONS}
sendsigs_omit
eend $?
}

stop() {
ebegin "${description_stop}"
start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --pidfile ${PIDFILE} --exec ${DAEMON}
eend $?
}

rotate() {
ebegin "Closing open files"
start-stop-daemon --stop --signal HUP --quiet --pidfile ${PIDFILE} --exec ${DAEMON}
eend $?
}

status() {
status
}

restart() {
ebegin "Restarting enhanced syslogd"
stop
start
eend $?
}

create_xconsole() {
XCONSOLE=/dev/xconsole
if [ "$(uname -s)" != "Linux" ]; then
XCONSOLE=/run/xconsole
ln -sf $XCONSOLE /dev/xconsole
fi
if [ ! -e $XCONSOLE ]; then
mknod -m 640 $XCONSOLE p
chown root:adm $XCONSOLE
[ -x /sbin/restorecon ] && /sbin/restorecon $XCONSOLE
fi
}

sendsigs_omit() {
OMITDIR=/run/sendsigs.omit.d
mkdir -p $OMITDIR
ln -sf $PIDFILE $OMITDIR/rsyslog
}
17 changes: 17 additions & 0 deletions gh-build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#! /bin/bash

set -x

### Basic Packages
apt -qq update
apt -qq -yy install equivs git devscripts lintian --no-install-recommends

### Install Dependencies
mk-build-deps -i -t "apt-get --yes" -r

### Build Deb
debuild -b -uc -us

### Move Deb to current directory because debuild decided
### that it was a GREAT IDEA TO PUT THE FILE ONE LEVEL ABOVE
mv ../*.deb .

0 comments on commit 9bdeb91

Please sign in to comment.