diff options
-rw-r--r-- | .SRCINFO | 10 | ||||
-rw-r--r-- | 01-adjust-config.patch | 133 | ||||
-rw-r--r-- | 02-adjust-service.patch | 29 | ||||
-rw-r--r-- | PKGBUILD | 62 | ||||
-rw-r--r-- | gitea.install | 21 | ||||
-rw-r--r-- | gitea.tmpfiles | 3 |
6 files changed, 77 insertions, 181 deletions
@@ -1,6 +1,6 @@ pkgbase = gitea-git pkgdesc = A painless self-hosted Git service. - pkgver = r5999.400232817 + pkgver = r6429.85414d8b7 pkgrel = 1 url = https://gitea.io/ install = gitea.install @@ -11,8 +11,8 @@ pkgbase = gitea-git arch = armv7h arch = aarch64 license = MIT - makedepends = go depends = git + depends = go optdepends = sqlite: SQLite support optdepends = mariadb: MariaDB support optdepends = postgresql: PostgreSQL support @@ -28,9 +28,11 @@ pkgbase = gitea-git source = git://github.com/go-gitea/gitea.git source = 01-adjust-config.patch source = 02-adjust-service.patch + source = gitea.tmpfiles sha512sums = SKIP - sha512sums = 67c61dbfb0002ec714423eda9310325158b6fed998969e9049c49f521f0f1ad0727f090460e00c26390bb1f817cfb55a7aed720f7b34d4afc8b10369c4fe5322 - sha512sums = dab5e8221c3d87062a079bb0289e3d9609122e76fca3b2b9faf3bce810602661af9435e46585c479151c2e46ff83edce7d18072dee7cbf4ac50c2419d8871c53 + sha512sums = 3f96361a5135ea11b438e2cad29f2033221c63c11d1f260474d589c469e5db760fbf4da0718f9d015e106b72a13c02ad2899a8a90ac07365e20b935b59e95a6c + sha512sums = a2be7742c6d39a78ebfa3a79fa32854fad8b4fb6595274b77a2f9244f574c4a47172e090f06fba411e498f9973d726e08c1f070891583b315de01442d434f1d4 + sha512sums = 0c6c9729f8dfd5b5fe2badf998e89624b00800f87ae1b28a68acd52f2621f3434cc3930a578d2bb3e27005f8ffbb0f4a0e4e4d3d2e2371d0214d36c805d65573 pkgname = gitea-git diff --git a/01-adjust-config.patch b/01-adjust-config.patch index 6596cedbb04b..5a0a262f8677 100644 --- a/01-adjust-config.patch +++ b/01-adjust-config.patch @@ -1,136 +1,39 @@ --- app.ini.sample -+++ app.ini.sample 2018-01-07 04:29:27.120000000 +0300 -@@ -7,10 +7,10 @@ ++++ app.ini.sample +@@ -7,12 +7,12 @@ + ; App name that shows in every page title + APP_NAME = Gitea: Git with a cup of tea ; Change it if you run locally - RUN_USER = git +-RUN_USER = git ++RUN_USER = gitea ; Either "dev", "prod" or "test", default is "dev" --RUN_MODE = dev -+RUN_MODE = prod + RUN_MODE = dev [repository] -ROOT = -+ROOT = /var/lib/gitea/repos ++ROOT = /home/gitea/gitea-repositories/ SCRIPT_TYPE = bash ; Default ANSI charset ANSI_CHARSET = -@@ -42,13 +42,13 @@ - - [repository.local] - ; Path for uploads. Defaults to `tmp/local-repo` --LOCAL_COPY_PATH = tmp/local-repo -+LOCAL_COPY_PATH = /var/lib/gitea/tmp/local-repo - - [repository.upload] - ; Whether repository file uploads are enabled. Defaults to `true` - ENABLED = true - ; Path for uploads. Defaults to `data/tmp/uploads` (tmp gets deleted on gitea restart) --TEMP_PATH = data/tmp/uploads -+TEMP_PATH = /var/lib/gitea/data/tmp/uploads - ; One or more allowed types, e.g. image/jpeg|image/png. Nothing means any file type - ALLOWED_TYPES = - ; Max size of each file in MB. Defaults to 3MB -@@ -136,7 +136,7 @@ - ; Port number builtin SSH server listens on +@@ -141,7 +141,7 @@ + ; The port number the builtin SSH server should listen on SSH_LISTEN_PORT = %(SSH_PORT)s ; Root path of SSH directory, default is '~/.ssh', but you have to use '/home/git/.ssh'. -SSH_ROOT_PATH = -+SSH_ROOT_PATH = /var/lib/gitea/.ssh - ; For built-in SSH server only, choose the ciphers to support for SSH connections, ++SSH_ROOT_PATH = /home/gitea/.ssh + ; For the built-in SSH server, choose the ciphers to support for SSH connections, ; for system SSH this setting has no effect SSH_SERVER_CIPHERS = aes128-ctr, aes192-ctr, aes256-ctr, aes128-gcm@openssh.com, arcfour256, arcfour128 -@@ -167,13 +167,13 @@ - ; not forget to export the private key): - ; $ openssl pkcs12 -in cert.pfx -out cert.pem -nokeys - ; $ openssl pkcs12 -in cert.pfx -out key.pem -nocerts -nodes --CERT_FILE = custom/https/cert.pem --KEY_FILE = custom/https/key.pem -+CERT_FILE = /var/lib/gitea/cert/cert.pem -+KEY_FILE = /var/lib/gitea/cert/key.pem - ; Upper level of template and static file path +@@ -176,7 +176,7 @@ + KEY_FILE = custom/https/key.pem + ; Root directory containing templates and static files. ; default is the path where Gitea is executed -STATIC_ROOT_PATH = -+STATIC_ROOT_PATH = /usr/share/gitea ++STATIC_ROOT_PATH = /var/lib/gitea ; Default path for App data --APP_DATA_PATH = data -+APP_DATA_PATH = /var/lib/gitea/data + APP_DATA_PATH = data ; Application level GZIP support - ENABLE_GZIP = false - ; Landing page, can be "home", "explore", or "organizations" -@@ -181,7 +181,7 @@ - ; Enables git-lfs support. true or false, default is false. - LFS_START_SERVER = false - ; Where your lfs files put on, default is data/lfs. --LFS_CONTENT_PATH = data/lfs -+LFS_CONTENT_PATH = /var/lib/gitea/data/lfs - ; LFS authentication secret, changed this to yourself. - LFS_JWT_SECRET = - -@@ -197,22 +197,22 @@ - DB_TYPE = mysql - HOST = 127.0.0.1:3306 - NAME = gitea --USER = root -+USER = gitea - PASSWD = - ; For "postgres" only, either "disable", "require" or "verify-full" - SSL_MODE = disable - ; For "sqlite3" and "tidb", use absolute path when you start as service --PATH = data/gitea.db -+PATH = /var/lib/gitea/gitea.db - ; For "sqlite3" only. Query timeout - SQLITE_TIMEOUT = 500 - ; For iterate buffer, default is 50 - ITERATE_BUFFER_SIZE = 50 - - [indexer] --ISSUE_INDEXER_PATH = indexers/issues.bleve -+ISSUE_INDEXER_PATH = /var/lib/gitea/indexers/issues.bleve - ; repo indexer by default disabled, since it uses a lot of disk space - REPO_INDEXER_ENABLED = false --REPO_INDEXER_PATH = indexers/repos.bleve -+REPO_INDEXER_PATH = /var/lib/gitea/indexers/repos.bleve - UPDATE_BUFFER_LEN = 20 - MAX_FILE_SIZE = 1048576 - -@@ -336,8 +336,8 @@ - SKIP_VERIFY = - ; Use client certificate - USE_CERTIFICATE = false --CERT_FILE = custom/mailer/cert.pem --KEY_FILE = custom/mailer/key.pem -+CERT_FILE = /var/lib/gitea/cert/cert.pem -+KEY_FILE = /var/lib/gitea/cert/key.pem - ; Mail from address, RFC 5322. This can be just an email address, or the `"Name" <email@example.com>` format - FROM = - ; Mailer user name and password -@@ -373,7 +373,7 @@ - ; file: session file path, e.g. `data/sessions` - ; redis: network=tcp,addr=:6379,password=macaron,db=0,pool_size=100,idle_timeout=180 - ; mysql: go-sql-driver/mysql dsn config string, e.g. `root:password@/session_table` --PROVIDER_CONFIG = data/sessions -+PROVIDER_CONFIG = /var/lib/gitea/data/sessions - ; Session cookie name - COOKIE_NAME = i_like_gitea - ; If you use session in https only, default is false -@@ -386,7 +386,7 @@ - SESSION_LIFE_TIME = 86400 - - [picture] --AVATAR_UPLOAD_PATH = data/avatars -+AVATAR_UPLOAD_PATH = /var/lib/gitea/data/avatars - ; Chinese users can choose "duoshuo" - ; or a custom avatar source, like: http://cn.gravatar.com/avatar/ - GRAVATAR_SOURCE = gravatar -@@ -401,7 +401,7 @@ - ; Whether attachments are enabled. Defaults to `true` - ENABLE = true - ; Path for attachments. Defaults to `data/attachments` --PATH = data/attachments -+PATH = /var/lib/gitea/data/attachments - ; One or more allowed types, e.g. image/jpeg|image/png - ALLOWED_TYPES = image/jpeg|image/png|application/zip|application/gzip - ; Max size of each file. Defaults to 32MB -@@ -416,7 +416,7 @@ +@@ -431,7 +431,7 @@ FORMAT = [log] diff --git a/02-adjust-service.patch b/02-adjust-service.patch index 7490456ba6ac..8cd24d70fdf3 100644 --- a/02-adjust-service.patch +++ b/02-adjust-service.patch @@ -1,16 +1,19 @@ --- gitea.service -+++ gitea.service 2018-01-07 04:29:41.890000000 +0300 -@@ -18,10 +18,10 @@ ++++ gitea.service +@@ -16,12 +16,12 @@ + #LimitNOFILE=65535 + RestartSec=2s Type=simple - User=git - Group=git --WorkingDirectory=/home/git/gitea --ExecStart=/home/git/gitea/gitea web -+WorkingDirectory=/var/lib/gitea -+ExecStart=/usr/bin/gitea web --config /etc/gitea/app.ini +-User=git +-Group=git ++User=gitea ++Group=gitea + WorkingDirectory=/var/lib/gitea/ +-ExecStart=/usr/local/bin/gitea web -c /etc/gitea/app.ini ++ExecStart=/usr/bin/gitea web -c /etc/gitea/app.ini Restart=always --Environment=USER=git HOME=/home/git -+Environment=USER=git HOME=/var/lib/gitea - - [Install] - WantedBy=multi-user.target +-Environment=USER=git HOME=/home/git GITEA_WORK_DIR=/var/lib/gitea ++Environment=USER=git HOME=/home/gitea GITEA_WORK_DIR=/var/lib/gitea + # If you want to bind Gitea to a port below 1024 uncomment + # the two values below + ### @@ -1,22 +1,20 @@ -# Maintainer: Anton Kudryavtsev <anton@anibit.ru> -# Contributor: Francois Menning <f.menning@protonmail.com> +# Maintainer: Francois Menning <f.menning@pm.me> +# Contributor: Anton Kudryavtsev <anton@anibit.ru> # Contributor: Frederik Schwan <frederik dot schwan at linux dot com> # Contributor: Thomas Fanninger <thomas@fanninger.at> # Contributor: Alexander F Rødseth <xyproto@archlinux.org> # Contributor: Thomas Laroche <tho.laroche@gmail.com> -_pkgname="gitea" -_gourl="code.gitea.io" - +_pkgname='gitea' +_gourl='code.gitea.io' pkgname=gitea-git pkgrel=1 -pkgver=r5999.400232817 -pkgdesc="A painless self-hosted Git service." -url="https://gitea.io/" -license=("MIT") +pkgver=r6429.85414d8b7 +pkgdesc='A painless self-hosted Git service.' +url='https://gitea.io/' +license=('MIT') arch=('x86_64' 'i686' 'arm' 'armv6h' 'armv7h' 'aarch64') -depends=("git") -makedepends=("go") +depends=('git' 'go') optdepends=('sqlite: SQLite support' 'mariadb: MariaDB support' 'postgresql: PostgreSQL support' @@ -24,17 +22,20 @@ optdepends=('sqlite: SQLite support' 'redis: Redis support' 'memcached: MemCached support' 'openssh: GIT over SSH support') -conflicts=("gitea") -provides=("gitea") -options=("!strip" "emptydirs") -backup=("etc/gitea/app.ini") +conflicts=('gitea') +provides=('gitea') +options=('!strip' 'emptydirs') +backup=('etc/gitea/app.ini') install=gitea.install -source=("git://github.com/go-gitea/gitea.git" - "01-adjust-config.patch" - "02-adjust-service.patch") +source=('git://github.com/go-gitea/gitea.git' + '01-adjust-config.patch' + '02-adjust-service.patch' + 'gitea.tmpfiles' +) sha512sums=('SKIP' - '67c61dbfb0002ec714423eda9310325158b6fed998969e9049c49f521f0f1ad0727f090460e00c26390bb1f817cfb55a7aed720f7b34d4afc8b10369c4fe5322' - 'dab5e8221c3d87062a079bb0289e3d9609122e76fca3b2b9faf3bce810602661af9435e46585c479151c2e46ff83edce7d18072dee7cbf4ac50c2419d8871c53') + '3f96361a5135ea11b438e2cad29f2033221c63c11d1f260474d589c469e5db760fbf4da0718f9d015e106b72a13c02ad2899a8a90ac07365e20b935b59e95a6c' + 'a2be7742c6d39a78ebfa3a79fa32854fad8b4fb6595274b77a2f9244f574c4a47172e090f06fba411e498f9973d726e08c1f070891583b315de01442d434f1d4' + '0c6c9729f8dfd5b5fe2badf998e89624b00800f87ae1b28a68acd52f2621f3434cc3930a578d2bb3e27005f8ffbb0f4a0e4e4d3d2e2371d0214d36c805d65573') pkgver() { cd "${srcdir}/${_pkgname}" @@ -52,21 +53,18 @@ prepare() { build() { cd "${srcdir}/src/${_gourl}/${_pkgname}" - GOPATH="${srcdir}" go get -v -u github.com/go-macaron/bindata - PATH="${srcdir}/bin:$PATH" GOPATH="${srcdir}" make DESTDIR="${pkgdir}/" TAGS="bindata sqlite tidb pam" clean generate build + PATH="${srcdir}/bin:$PATH" GOPATH="${srcdir}" make DESTDIR="${pkgdir}/" TAGS="sqlite tidb pam" clean generate build } package() { - install -dm0700 "${pkgdir}/var/log/${_pkgname}/" - install -dm0700 "${pkgdir}/var/lib/${_pkgname}/" - install -dm0755 "${pkgdir}/usr/share/${_pkgname}/" + cd "${srcdir}/src/${_gourl}/${_pkgname}" + + install -dm0750 "${pkgdir}/"{etc,var/log,var/lib}/${_pkgname} - cp -r "${srcdir}/src/${_gourl}/${_pkgname}/custom" "${pkgdir}/usr/share/${_pkgname}" - cp -r "${srcdir}/src/${_gourl}/${_pkgname}/public" "${pkgdir}/usr/share/${_pkgname}" - cp -r "${srcdir}/src/${_gourl}/${_pkgname}/templates" "${pkgdir}/usr/share/${_pkgname}" + cp -r {custom,public,options,templates} "${pkgdir}/var/lib/${_pkgname}" - install -Dm0755 "${srcdir}/src/${_gourl}/${_pkgname}/${_pkgname}" "${pkgdir}/usr/bin/${_pkgname}" - install -Dm0644 "${srcdir}/src/${_gourl}/${_pkgname}/custom/conf/app.ini.sample" "${pkgdir}/etc/${_pkgname}/app.ini" - install -Dm0644 "${srcdir}/src/${_gourl}/${_pkgname}/contrib/systemd/${_pkgname}.service" "${pkgdir}/usr/lib/systemd/system/${_pkgname}.service" - install -Dm0644 "${srcdir}/src/${_gourl}/${_pkgname}/LICENSE" "${pkgdir}/usr/share/licenses/${_pkgname}" + install -Dm0755 "${_pkgname}" "${pkgdir}/usr/bin/${_pkgname}" + install -Dm0644 "custom/conf/app.ini.sample" "${pkgdir}/etc/${_pkgname}/app.ini" + install -Dm0644 "contrib/systemd/${_pkgname}.service" "${pkgdir}/usr/lib/systemd/system/${_pkgname}.service" + install -Dm0644 "LICENSE" "${pkgdir}/usr/share/licenses/${_pkgname}" } diff --git a/gitea.install b/gitea.install index 7db55e1e4512..d01cff059a7c 100644 --- a/gitea.install +++ b/gitea.install @@ -1,27 +1,14 @@ pre_install() { - usermod -d /var/lib/gitea -s /usr/bin/bash git + useradd -d /home/gitea -m -r -U -s /usr/bin/bash gitea } post_install() { - chown -R git:git /var/lib/gitea - chown -R git:git /var/log/gitea - chown -R git:git /etc/gitea + chown -R gitea:gitea /var/lib/gitea + chown -R gitea:gitea /var/log/gitea + chown -R gitea:gitea /etc/gitea systemctl daemon-reload } -pre_upgrade() { - pre_install $1 -} - post_upgrade() { post_install $1 } - -pre_remove() { - systemctl stop gitea.service - systemctl disable gitea.service -} - -post_remove() { - usermod -d / -s /usr/bin/git-shell git -} diff --git a/gitea.tmpfiles b/gitea.tmpfiles new file mode 100644 index 000000000000..c18942eff504 --- /dev/null +++ b/gitea.tmpfiles @@ -0,0 +1,3 @@ +d /var/lib/gitea 0750 gitea gitea - +d /var/log/gitea 0750 gitea gitea - +d /etc/gitea 0750 gitea gitea - |