gitea first commit slackbuilds

This commit is contained in:
2026-04-07 17:08:43 -03:00
commit dde5c94590
21 changed files with 1880 additions and 0 deletions

64
slackbuilds/README Normal file
View File

@@ -0,0 +1,64 @@
gitea: A self-hosted Git service
Gitea is a painless self-hosted all-in-one software development service.
It includes Git hosting, code review, team collaboration, package
registry, and CI/CD. Written in Go, lightweight and easy to deploy.
This package installs the pre-built binary from the official Gitea
website. Only x86_64 architecture is supported.
The package automatically creates a "git" user and group for the
Gitea service. The git user shell is set to /bin/bash, which is
required for SSH passthrough mode.
Post-installation steps:
1. Enable the init script:
chmod +x /etc/rc.d/rc.gitea
2. Add to /etc/rc.d/rc.local:
if [ -x /etc/rc.d/rc.gitea ]; then
/etc/rc.d/rc.gitea start
fi
3. Add to /etc/rc.d/rc.local_shutdown:
if [ -x /etc/rc.d/rc.gitea ]; then
/etc/rc.d/rc.gitea stop
fi
4. Start the service:
/etc/rc.d/rc.gitea start
5. Open http://localhost:3000/ in your browser to run the
web installer and create your admin account.
6. After the web installer completes, restrict config permissions:
chmod 640 /etc/gitea/app.ini
chmod 750 /etc/gitea
Files installed:
/usr/bin/gitea - Gitea binary
/etc/gitea/app.ini - Configuration file
/etc/rc.d/rc.gitea - Init script
/var/lib/gitea/ - Working directory
/var/lib/gitea/custom/public/assets/img/ - Custom logo/favicon
/var/lib/gitea/data/ - Database and repositories
/var/lib/gitea/log/ - Log files
/usr/doc/gitea-1.25.5/ - Documentation
Uninstalling:
removepkg gitea
This removes the binary, init script, config directory, custom
files, and logs. It does NOT remove:
- The git user and group
- User repositories (under /var/lib/gitea/data/gitea-repositories/)
To completely remove all data after uninstall:
rm -rf /var/lib/gitea
userdel git
groupdel git
For more information, see https://docs.gitea.com/

33
slackbuilds/doinst.sh Normal file
View File

@@ -0,0 +1,33 @@
#!/bin/sh
# doinst.sh - Post-installation script for gitea
# Create git group if it doesn't exist
if ! getent group git > /dev/null 2>&1; then
groupadd -r git
fi
# Create git user if it doesn't exist
if ! getent passwd git > /dev/null 2>&1; then
useradd -r -g git -d /var/lib/gitea -s /bin/bash -c "Gitea service" git
fi
# Set ownership on gitea directories
chown -R git:git /var/lib/gitea/
chmod -R 750 /var/lib/gitea/
chown root:git /etc/gitea
chmod 770 /etc/gitea
# Handle .new configuration files
config()
{
NEW="$1"
OLD="$(dirname $NEW)/$(basename $NEW .new)"
if [ ! -r "$OLD" ]; then
mv "$NEW" "$OLD"
elif [ "$(cat $OLD | md5sum)" = "$(cat $NEW | md5sum)" ]; then
rm "$NEW"
fi
}
config etc/gitea/app.ini.new
config etc/rc.d/rc.gitea.new

31
slackbuilds/douninst.sh Normal file
View File

@@ -0,0 +1,31 @@
#!/bin/sh
# douninst.sh - Post-removal script for gitea
#
# Removes package files and directories.
# Preserves: git user, git group, and user repositories.
# Remove binary
rm -f /usr/bin/gitea
# Remove rc script
rm -f /etc/rc.d/rc.gitea
# Remove config directory (includes app.ini)
rm -rf /etc/gitea
# Remove custom files and logs (but not repository data)
rm -rf /var/lib/gitea/custom
rm -rf /var/lib/gitea/log
# Remove data dir contents EXCEPT gitea-repositories/
if [ -d /var/lib/gitea/data ]; then
find /var/lib/gitea/data -mindepth 1 -maxdepth 1 \
! -name "gitea-repositories" -exec rm -rf {} +
# Remove data/ only if empty (repositories dir may remain)
rmdir /var/lib/gitea/data 2>/dev/null
fi
# Remove top-level gitea dir only if empty
rmdir /var/lib/gitea 2>/dev/null
# Documentation is removed automatically by removepkg

135
slackbuilds/gitea.SlackBuild Executable file
View File

@@ -0,0 +1,135 @@
#!/bin/bash
#
# SlackBuild script for gitea
# License: GNU General Public License Version 3
# Template automatically generated by pacoteco
# Copyright 2026 by Ruben Carlo Benante <rcb@beco.cc>
# All rights reserved.
#
# Redistribution and use of this script, with or without modification,
# is permitted provided that the conditions from the license are met.
#
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR "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 AUTHOR 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.
#----------------------------------------------------------------------#
# More information in the COPYING, README and gitea.info files. #
#----------------------------------------------------------------------#
# Save current working directory (slackbuilds/) ########################
cd $(dirname $0) ; CWD=$(pwd)
# Program metadata #####################################################
PRGNAM=gitea
VERSION=${VERSION:-1.25.5}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
PKGTYPE=${PKGTYPE:-tgz}
# Architecture detection ###############################################
ARCH="" # Set to ARCH="noarch" if it is a script
if [ -z "${ARCH}" ]; then
case "$(uname -m)" in
i?86) ARCH=i586 ;;
arm*) ARCH=arm ;;
x86_64) ARCH=x86_64 ;;
*) ARCH=$(uname -m) ; echo "Warning: unknown architecture" ;;
esac
fi
# PRINT_PACKAGE_NAME section ###########################################
if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
echo "${PRGNAM}-${VERSION}-${ARCH}-${BUILD}${TAG}.${PKGTYPE}"
exit 0
fi
# Set up build environment #############################################
TMP=${TMP:-/tmp/SBo}
PKG=${TMP}/package-${PRGNAM}
OUTPUT=${OUTPUT:-/tmp}
PRGVERSRC="${PRGNAM}-${VERSION}-src"
# Exit on errors #######################################################
set -e
# Prepare staging area #################################################
rm -rf ${PKG}
mkdir -p ${TMP} ${PKG} ${OUTPUT}
cd ${TMP} || { echo "Can't change into ${TMP} directory" ; exit 1 ; }
rm -rf ${PRGVERSRC}
# Extract source tarball ###############################################
if [ -f ${CWD}/${PRGVERSRC}.tar.gz ]; then
tar -xvf ${CWD}/${PRGVERSRC}.tar.gz
else
echo "Error: ${CWD}/${PRGVERSRC}.tar.gz not found"
exit 1
fi
# Change to source directory ###########################################
cd "${PRGVERSRC}" || { echo "Can't change into ${PRGVERSRC} directory" ; exit 1 ; }
# Set ownership and permissions ########################################
chown -R root:root .
find -L . \
\( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 -o -perm 511 \) \
-exec chmod 755 {} \; -o \
\( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
-exec chmod 644 {} \;
# Build source #########################################################
make ARCH=${ARCH}
# Install files from appletree (MakeInstall created by pacoteco -m) ####
# Alternative installation method:
# make install DESTDIR=${PKG}
# Install files from appletree (MakeInstall created by pacoteco -m)
# PACOTECO MARKER - DO NOT REMOVE - INSTALL COMMANDS - BEGIN ###########
# Slackbuild files to install/ directory
install -Dm 0644 ${CWD}/slack-desc ${PKG}/install/slack-desc
install -Dm 0644 ${CWD}/doinst.sh ${PKG}/install/doinst.sh
# SlackBuild files to usr/doc/ directory
install -Dm 0644 ${CWD}/slack-desc ${PKG}/usr/doc/gitea-1.25.5/slack-desc
install -Dm 0644 ${CWD}/doinst.sh ${PKG}/usr/doc/gitea-1.25.5/doinst.sh
install -Dm 0644 ${CWD}/gitea.info ${PKG}/usr/doc/gitea-1.25.5/gitea.info
install -Dm 0644 ${CWD}/README ${PKG}/usr/doc/gitea-1.25.5/README
install -Dm 0644 ${CWD}/COPYING ${PKG}/usr/doc/gitea-1.25.5/COPYING
install -Dm 0644 ${CWD}/gitea.SlackBuild ${PKG}/usr/doc/gitea-1.25.5/gitea.SlackBuild
# Documentation, man pages and package files
install -Dm 644 ${TMP}/${PRGVERSRC}/build/.gitkeep ${PKG}/var/lib/gitea/custom/public/assets/img/.gitkeep
install -Dm 644 ${TMP}/${PRGVERSRC}/build/.gitkeep ${PKG}/var/lib/gitea/log/.gitkeep
install -Dm 644 ${TMP}/${PRGVERSRC}/build/.gitkeep ${PKG}/var/lib/gitea/data/.gitkeep
install -Dm 640 ${TMP}/${PRGVERSRC}/build/app.ini.new ${PKG}/etc/gitea/app.ini.new
install -Dm 644 ${TMP}/${PRGVERSRC}/build/rc.gitea.new ${PKG}/etc/rc.d/rc.gitea.new
install -Dm 755 ${TMP}/${PRGVERSRC}/build/gitea ${PKG}/usr/bin/gitea
install -Dm 644 ${TMP}/${PRGVERSRC}/build/COPYING ${PKG}/usr/doc/gitea-1.25.5/COPYING
install -Dm 644 ${TMP}/${PRGVERSRC}/build/VERSION ${PKG}/usr/doc/gitea-1.25.5/VERSION
# PACOTECO MARKER - DO NOT REMOVE - INSTALL COMMANDS - END #############
# Install douninst.sh (not managed by pacoteco) ########################
install -Dm 0644 ${CWD}/douninst.sh ${PKG}/install/douninst.sh
# Strip binaries (optional, uncomment if needed) #######################
find ${PKG} -print0 | xargs -0 file | grep -e "executable" -e "shared object" \
| grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
# Compress man pages (done by make) ####################################
# find ${PKG}/usr/man -type f -exec gzip -9 {} \;
# for i in $( find ${PKG}/usr/man -type l ) ; do ln -s $( readlink ${i} ).gz ${i}.gz ; rm ${i} ; done
# Make the package #####################################################
cd ${PKG}
/sbin/makepkg -l y -c n ${OUTPUT}/${PRGNAM}-${VERSION}-${ARCH}-${BUILD}${TAG}.${PKGTYPE}
#-----------------------------------------------------------------------
# vi: set ai et ts=4 sw=4 tw=0 wm=0 fo=croql syn=sh : Shell Vim modeline
# Template by Dr. Beco <rcb at beco dot cc> Version 20250704.084004

10
slackbuilds/gitea.info Normal file
View File

@@ -0,0 +1,10 @@
PRGNAM="gitea"
VERSION="1.25.5"
HOMEPAGE="https://about.gitea.com"
DOWNLOAD="https://beco.cc/downloads/slackware/src/gitea-1.25.5-src.tar.gz"
MD5SUM="2ad79fbcffb8f1f3cfdc48912ba64332"
DOWNLOAD_x86_64=""
MD5SUM_x86_64=""
REQUIRES="git"
MAINTAINER="Ruben Carlo Benante"
EMAIL="rcb@beco.cc"

19
slackbuilds/slack-desc Normal file
View File

@@ -0,0 +1,19 @@
# HOW TO EDIT THIS FILE:
# The "handy ruler" below makes it easier to edit a package description.
# Line up the first '|' above the ':' following the package name, and
# the '|' on the right side marks the last column you should put a
# character in. You must make exactly 11 lines for the formatting to
# be correct. It's also customary to leave one space after the ':'.
|-----handy-ruler------------------------------------------------------|
gitea: gitea (self-hosted Git service)
gitea:
gitea: Gitea is a painless self-hosted all-in-one software development
gitea: service. It includes Git hosting, code review, team collaboration,
gitea: package registry, and CI/CD. It is lightweight, written in Go,
gitea: and easy to deploy.
gitea:
gitea: This package installs the pre-built binary with SQLite support.
gitea:
gitea:
gitea: Homepage: https://about.gitea.com