diff options
-rw-r--r-- | .SRCINFO | 14 | ||||
-rw-r--r-- | .gitignore | 8 | ||||
-rw-r--r-- | PKGBUILD | 42 | ||||
-rw-r--r-- | gogs.install | 45 | ||||
-rw-r--r-- | gogs.service | 4 | ||||
-rw-r--r-- | gogs.sysusers | 1 | ||||
-rw-r--r-- | gogs.tmpfiles | 2 |
7 files changed, 57 insertions, 59 deletions
@@ -1,8 +1,8 @@ pkgbase = gogs-dev-git pkgdesc = Self Hosted Git Service in the Go Programming Language. This is the current git version from branch develop. - pkgver = 0.11.12.0529+10+612a7e76f + pkgver = 0.11.55.0609+3+459c8be94 pkgrel = 1 - url = http://gogs.io/ + url = https://gogs.io install = gogs.install arch = i686 arch = x86_64 @@ -15,6 +15,7 @@ pkgbase = gogs-dev-git makedepends = nodejs-less makedepends = sqlite depends = git + depends = pam optdepends = sqlite: SQLite support optdepends = mariadb: MariaDB support optdepends = postgresql: PostgreSQL support @@ -26,12 +27,15 @@ pkgbase = gogs-dev-git conflicts = gogs options = !buildflags options = !strip - source = git+https://github.com/gogits/gogs.git#branch=develop + options = emptydirs + source = git+https://github.com/gogs/gogs.git#branch=develop source = gogs.service + source = gogs.sysusers source = gogs.tmpfiles sha512sums = SKIP - sha512sums = c872a0c7e33c3385828af58633f194628098841adb32506fdb95d0554ecae2a472915d3fb4a964b44bf8f14e87516f50f77fbec9a3efd10bfb2f5246d294a186 - sha512sums = 658935dc129d41b4bfc205ea8e9c225122862431f8b96932942ec345bc23cc7b55644247a8844c1f66bfd16ee35fc9da766f62f07603cbe6d573102edb4222f8 + sha512sums = 26fa3b9579ec2780e56f4a52870461b9cc1e4c1608e006b0759de7c5de137895d48e94a1694341b545be0dae87c966a982d8b581397d56fad83ab12e297f98df + sha512sums = 0a546902ffb9fe99f61b301183059cc85c75408cd735f04ee93829ad6e3d66a07ebc73ce663743f109ea6303c1815933a17fe2b83bf9104d1528acb5aa63faf8 + sha512sums = a48c51665079575aa9e4774e9d6ccaf15880c81d3d8d77dbcc0871133be7907177694986f12a5d880aa1930a636ca42b5ccb2dbb91874ad9f3c31fa6e5218c6b pkgname = gogs-dev-git diff --git a/.gitignore b/.gitignore index d53d19106dd9..512ba7b0b717 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ -pkg/ -src/ -*.pkg.tar.* +/pkg/ +/src/ +/bin/ +/*.pkg.tar* +/*.log @@ -5,44 +5,39 @@ _branch=develop _pkgname=gogs -_team=github.com/gogits -_gogsdir="src/${_team}/${_pkgname}" +_team=github.com/gogs +_gogsdir="${_team}/${_pkgname}" pkgname=${_pkgname}-dev-git -pkgver=0.11.12.0529+10+612a7e76f +pkgver=0.11.55.0609+3+459c8be94 pkgrel=1 pkgdesc="Self Hosted Git Service in the Go Programming Language. This is the current git version from branch ${_branch}." arch=('i686' 'x86_64' 'armv6h' 'armv7h') -url="http://${_pkgname}.io/" +url="https://${_pkgname}.io" license=('MIT') -conflicts=("${_pkgname}") -provides=("${_pkgname}") -depends=('git') -options=('!buildflags' '!strip') +depends=('git' 'pam') optdepends=("sqlite: SQLite support" "mariadb: MariaDB support" "postgresql: PostgreSQL support" "redis: Redis support" "memcached: MemCached support" "openssh: GIT over SSH support" - "bash: GIT over SSH support" -) + "bash: GIT over SSH support") makedepends=('git' 'go' 'go-bindata-git' 'nodejs-less' 'sqlite') +conflicts=("${_pkgname}") +provides=("${_pkgname}") +options=('!buildflags' '!strip' 'emptydirs') install=${_pkgname}.install -source=( - "git+https://${_team}/${_pkgname}.git#branch=${_branch}" +source=("git+https://${_team}/${_pkgname}.git#branch=${_branch}" "${_pkgname}.service" - "${_pkgname}.tmpfiles" -) -sha512sums=('SKIP' - 'c872a0c7e33c3385828af58633f194628098841adb32506fdb95d0554ecae2a472915d3fb4a964b44bf8f14e87516f50f77fbec9a3efd10bfb2f5246d294a186' - '658935dc129d41b4bfc205ea8e9c225122862431f8b96932942ec345bc23cc7b55644247a8844c1f66bfd16ee35fc9da766f62f07603cbe6d573102edb4222f8') + "${_pkgname}.sysusers" + "${_pkgname}.tmpfiles") prepare() { export GOPATH="$srcdir" - mkdir -p ./src/${_team} - mv -t ./src/${_team} ./${_pkgname} + mkdir -p "$srcdir/${_team}" + mv -v -t "$srcdir/${_team}" ./${_pkgname} cd "$srcdir/$_gogsdir" @@ -54,7 +49,7 @@ prepare() { } pkgver() { - cd "$_gogsdir" + cd "$srcdir/$_gogsdir" printf '%s+%s+%s' \ $(sed -e 's,/,+,g; s, ,,g' templates/.VERSION) \ $(git rev-list --count HEAD...$(git log --pretty=format:%H -n 1 -- templates/.VERSION)) \ @@ -67,6 +62,7 @@ build() { cd "$srcdir/$_gogsdir" + go fix LDFLAGS='-s -w' make PATH="$GOPATH/bin:$PATH" TAGS='libsqlite3 sqlite pam cert' build } @@ -83,4 +79,10 @@ package() { install -Dm0644 -t "$pkgdir/usr/lib/systemd/system" "$srcdir/${_pkgname}.service" install -Dm0644 "$srcdir/${_pkgname}.tmpfiles" "$pkgdir/usr/lib/tmpfiles.d/${_pkgname}.conf" + install -Dm0644 "$srcdir/${_pkgname}.sysusers" "$pkgdir/usr/lib/sysusers.d/${_pkgname}.conf" } + +sha512sums=('SKIP' + '26fa3b9579ec2780e56f4a52870461b9cc1e4c1608e006b0759de7c5de137895d48e94a1694341b545be0dae87c966a982d8b581397d56fad83ab12e297f98df' + '0a546902ffb9fe99f61b301183059cc85c75408cd735f04ee93829ad6e3d66a07ebc73ce663743f109ea6303c1815933a17fe2b83bf9104d1528acb5aa63faf8' + 'a48c51665079575aa9e4774e9d6ccaf15880c81d3d8d77dbcc0871133be7907177694986f12a5d880aa1930a636ca42b5ccb2dbb91874ad9f3c31fa6e5218c6b') diff --git a/gogs.install b/gogs.install index 86c2f108f24e..eaa5aa5e62b5 100644 --- a/gogs.install +++ b/gogs.install @@ -19,20 +19,16 @@ _disable_if_enabled() { fi } +_gogs_home=/var/lib/gogs + pre_install() { - if ! getent group gogs >/dev/null; then - groupadd --system gogs - fi - if ! getent passwd gogs >/dev/null; then - useradd -r -c 'Gogs service user' -g gogs -d /srv/gogs -s /bin/bash gogs - passwd -q -l gogs - else + if getent passwd gogs >/dev/null; then local _OldHome="$( getent passwd gogs | cut -d: -f6 )" - if [[ ${_OldHome} != "/srv/gogs" ]]; then - echo " Setting gogs home directory to /srv/gogs" - echo " You must migrate from ${_OldHome}" + if [[ ${_OldHome} != "${_gogs_home}" ]]; then + echo " Setting gogs home directory to ${_gogs_home}" + echo " You must migrate from ${_OldHome}" to ${_gogs_home} echo " before starting or re-enabling service" - usermod -c 'Gogs service user' -g gogs -d /srv/gogs -L -s /bin/bash gogs + usermod -c 'Gogs service user' -g gogs -d ${_gogs_home} -L -s /bin/bash gogs _disable_if_enabled fi fi @@ -40,12 +36,13 @@ pre_install() { post_install(){ systemctl daemon-reload - echo " If you do not have a custom configuration files finish the setup:" - echo " 1) systemctl start gogs.service" + echo " If you do not have a custom configuration file finish the setup:" + echo " 1) start gogs service" echo " 2) open the installation page http://$(uname -n):3000/" echo " Otherwise:" - echo " Place your custom configuration files in /srv/gogs/custom/conf" - echo " The default configuration file is located at" + echo " Place your custom configuration file in ${_gogs_home}/custom/conf/app.ini" + echo "" + echo " Default configuration can be located at:" echo " /usr/share/gogs/conf/app.ini.default" } @@ -57,19 +54,11 @@ pre_upgrade() { post_upgrade() { systemctl daemon-reload - local _CustConf=/srv/gogs/custom/conf/app.ini - local _OldConf=/etc/gogs/app.ini + local _CustConf=${_gogs_home}/custom/conf/app.ini - if [[ -f ${_OldConf}.pacsave ]] && [[ ! -f ${_CustConf} ]] ; then - install -Dm0750 -d -o gogs -g gogs /srv/gogs - install -Dm0750 -d -o gogs -g gogs /srv/gogs/custom - install -Dm0750 -d -o gogs -g gogs /srv/gogs/custom/conf - install -Dm0640 -T -o gogs -g gogs ${_OldConf}.pacsave ${_CustConf} - echo " ${_OldConf} copied to" - echo " ${_CustConf}." - echo " You may need to manually delete" - echo " an old config file:" - echo " ${_OldConf}" + if [ ! -f ${_CustConf} ] ; then + echo " Gogs old configuration file must be moved to ${_CustConf} before starting service." + _disable_if_enabled fi _start_if_enabled } @@ -87,5 +76,5 @@ post_remove() { groupdel gogs fi systemctl daemon-reload - echo " You may need to manually delete an old workdir /srv/gogs" + echo " You may need to manually remove an old Gogs home: ${_gogs_home}" } diff --git a/gogs.service b/gogs.service index 0aa04189978e..9eaa603b9f84 100644 --- a/gogs.service +++ b/gogs.service @@ -7,9 +7,9 @@ After=network.target Type=simple User=gogs Group=gogs -Environment=GOGS_WORK_DIR=/srv/gogs USER=gogs HOME=/srv/gogs +Environment=GOGS_WORK_DIR=/var/lib/gogs USER=gogs HOME=/var/lib/gogs ExecStart=/usr/bin/gogs web -WorkingDirectory=/srv/gogs +WorkingDirectory=/var/lib/gogs Restart=always [Install] diff --git a/gogs.sysusers b/gogs.sysusers new file mode 100644 index 000000000000..de61ce626054 --- /dev/null +++ b/gogs.sysusers @@ -0,0 +1 @@ +u gogs - "Go Git Service" /var/lib/gogs /bin/bash diff --git a/gogs.tmpfiles b/gogs.tmpfiles index 545bb8560f77..fd7743fed86f 100644 --- a/gogs.tmpfiles +++ b/gogs.tmpfiles @@ -1,2 +1,2 @@ -d /srv/gogs 0750 gogs gogs - +d /var/lib/gogs 0700 gogs gogs - d /var/log/gogs 0750 gogs log - |