Quellcode durchsuchen

Update build script + add some workarounds

Thomas Fanninger vor 10 Jahren
Ursprung
Commit
d6705d775c
8 geänderte Dateien mit 200 neuen und 62 gelöschten Zeilen
  1. 7 10
      .SRCINFO
  2. 15 10
      PKGBUILD
  3. 8 8
      app.ini.patch
  4. 74 13
      app_new.ini
  5. 74 13
      app_old.ini
  6. 1 1
      gogs.service
  7. 21 3
      helper.sh
  8. 0 4
      start.sh

+ 7 - 10
.SRCINFO

@@ -1,6 +1,6 @@
 pkgbase = gogs-git-dev
-	pkgdesc = Gogs(Go Git Service) is a Self Hosted Git Service in the Go Programming Language. This is the current git version from branch dev.
-	pkgver = 20150116
+	pkgdesc = Gogs(Go Git Service) is a Self Hosted Git Service in the Go Programming Language. This is the current git version from branch develop.
+	pkgver = 20150823
 	pkgrel = 1
 	epoch = 1
 	url = http://gogs.io/
@@ -11,8 +11,7 @@ pkgbase = gogs-git-dev
 	arch = armv7h
 	license = MIT
 	makedepends = go>=1.2
-	makedepends = git
-	makedepends = mercurial
+	makedepends = git>=1.7.1
 	makedepends = patch
 	depends = git>=1.7.1
 	optdepends = sqlite: SQLite support
@@ -29,13 +28,11 @@ pkgbase = gogs-git-dev
 	backup = srv/gogs/conf/app.ini
 	source = gogs.service
 	source = app.ini.patch
-	source = start.sh
 	source = helper.sh
-	source = gogs::git+https://github.com/gogits/gogs.git#branch=dev
-	sha512sums = 65bd06d530809917134b4fa2668136ada3e0cdc5a9c684ac422a973ad1c40c341d62cebf2ef14ee6275a134979d67cb314ec801a5a35ff1fb4e823aab671a151
-	sha512sums = a09134a50b7369715f65553003db954ca3193ee2556fc3d8aa98c717aa2f2b275d691f1c7c62464ec8f32e800d8ddf814c75546317ab623d2bd9331c5702380d
-	sha512sums = d759778b73d78fb705dad7b3cb486a2e366fdf3222bd170823579407a9aba9d281423b1026a22d142fc9abf620a40a14880254105129071956870e3048dd8bc3
-	sha512sums = 1e83441ebb24efe00e80f35eea6ed6d64a48194df3a3c90b02cd52a65099e8dfe046e0f914ac3dac7e4a30c854d967e2d5c928ee801f44053208dde2728fa17f
+	source = gogs::git+https://github.com/gogits/gogs.git#branch=develop
+	sha512sums = 2b4303f850e3b13b2fc3c9f0bc5820dae431d228002b35f01be0d4bfbcf05de8dcec2a559a85e318b609e4a4d492d44306eadf5f6508fd72333b198661bb0bb7
+	sha512sums = 939be9ad851ae6e20b786e2e189b0b67c0198edfc8c83442934ec48c7be073e03c75172e79f23a6ee1e0eb467c6fa18096a66d69d1142ebba28fdc8bb2a3964c
+	sha512sums = e746dbdafc4c8d0b15a224dba95ae3151611ba9ff468ee6f0b1789e489955e4d7eaac0dbdf28a22e5b8211559af5950726f4a37d699a2490fd349f034401028c
 	sha512sums = SKIP
 
 pkgname = gogs-git-dev

+ 15 - 10
PKGBUILD

@@ -3,8 +3,8 @@
 
 pkgname=gogs-git-dev
 _pkgname=gogs
-_branch=dev
-pkgver=20150116
+_branch=develop
+pkgver=20150823
 pkgrel=1
 epoch=1
 pkgdesc="Gogs(Go Git Service) is a Self Hosted Git Service in the Go Programming Language. This is the current git version from branch ${_branch}."
@@ -18,7 +18,7 @@ optdepends=('sqlite: SQLite support'
             'redis: Redis support'
             'memcached: MemCached support'
             'openssh: GIT over SSH support')
-makedepends=('go>=1.2' 'git' 'mercurial' 'patch')
+makedepends=('go>=1.2' 'git>=1.7.1' 'patch')
 conflicts=('gogs-bin' 'gogs' 'gogs-git')
 options=('!strip' '!emptydirs')
 backup=('srv/gogs/conf/app.ini')
@@ -28,14 +28,12 @@ install=gogs.install
 _gourl=github.com/gogits/$_pkgname
 source=('gogs.service'
         'app.ini.patch'
-        'start.sh'
         'helper.sh'
         "$_pkgname::git+https://${_gourl}.git#branch=${_branch}")
 
-sha512sums=('65bd06d530809917134b4fa2668136ada3e0cdc5a9c684ac422a973ad1c40c341d62cebf2ef14ee6275a134979d67cb314ec801a5a35ff1fb4e823aab671a151'
-            'a09134a50b7369715f65553003db954ca3193ee2556fc3d8aa98c717aa2f2b275d691f1c7c62464ec8f32e800d8ddf814c75546317ab623d2bd9331c5702380d'
-            'd759778b73d78fb705dad7b3cb486a2e366fdf3222bd170823579407a9aba9d281423b1026a22d142fc9abf620a40a14880254105129071956870e3048dd8bc3'
-            '1e83441ebb24efe00e80f35eea6ed6d64a48194df3a3c90b02cd52a65099e8dfe046e0f914ac3dac7e4a30c854d967e2d5c928ee801f44053208dde2728fa17f'
+sha512sums=(2b4303f850e3b13b2fc3c9f0bc5820dae431d228002b35f01be0d4bfbcf05de8dcec2a559a85e318b609e4a4d492d44306eadf5f6508fd72333b198661bb0bb7
+            939be9ad851ae6e20b786e2e189b0b67c0198edfc8c83442934ec48c7be073e03c75172e79f23a6ee1e0eb467c6fa18096a66d69d1142ebba28fdc8bb2a3964c
+            e746dbdafc4c8d0b15a224dba95ae3151611ba9ff468ee6f0b1789e489955e4d7eaac0dbdf28a22e5b8211559af5950726f4a37d699a2490fd349f034401028c
             'SKIP')
 
 _goroot="/usr/lib/go"
@@ -71,12 +69,20 @@ prepare() {
   export GOPATH="$srcdir/build"
   
   mkdir -p "$GOPATH/src/github.com/gogits"
+
   mv "$srcdir/$_pkgname" $GOPATH/src/${_gourl}
 
   msg2 "Check and download dependencies from .gopmfile"
   get_gopm "$GOPATH/src/${_gourl}/.gopmfile" "$GOPATH/src"
 
-#  go_get code.google.com/p/go.crypto "$GOPATH/src/go.crypto"
+  msg2 "Download missing dependencies"
+  go_get github.com/shurcooL/sanitized_anchor_name "$GOPATH/src/github.com/shurcooL/sanitized_anchor_name"
+#  go_get golang.org/x/net "$GOPATH/src/golang.org/x/net"
+#  go_get golang.org/x/text "$GOPATH/src/golang.org/x/text"
+
+  msg2 "Workaround dependencies"
+  cd "$GOPATH/src/github.com/gogits/go-gogs-client/"
+  git checkout -q master
 
   # Execute patch
   msg2 "Execute patches"
@@ -92,7 +98,6 @@ build() {
 }
 
 package() {
-  install -Dm0755 "$srcdir/start.sh" "$pkgdir/usr/share/$_pkgname/start.sh"
   install -Dm0755 "$srcdir/build/src/${_gourl}/$_pkgname" "$pkgdir/usr/share/$_pkgname/$_pkgname"
 
   cp -r "$srcdir/build/src/${_gourl}/conf" "$pkgdir/usr/share/$_pkgname"

+ 8 - 8
app.ini.patch

@@ -1,32 +1,32 @@
-4c4
+7c7
 < RUN_USER = git
 ---
 > RUN_USER = gogs
-9c9
+12c12
 < ROOT =
 ---
 > ROOT = /srv/gogs/repo
-34c34
+43c43
 < STATIC_ROOT_PATH =
 ---
 > STATIC_ROOT_PATH = /usr/share/themes/gogs/default
-50c50
+59c59
 < PATH = data/gogs.db
 ---
 > PATH = /srv/gogs/sqlite/gogs.db
-163c163
+184c184
 < PROVIDER_CONFIG = data/sessions
 ---
 > PROVIDER_CONFIG = /srv/gogs/sessions
-178c178
+199c199
 < AVATAR_UPLOAD_PATH = data/avatars
 ---
 > AVATAR_UPLOAD_PATH = /srv/gogs/data/avatars
-187c187
+209c209
 < PATH = data/attachments
 ---
 > PATH = /srv/gogs/data/attachments
-202c202
+224c224
 < ROOT_PATH =
 ---
 > ROOT_PATH = /var/log/gogs

+ 74 - 13
app_new.ini

@@ -1,3 +1,6 @@
+# NEVER EVER MODIFY THIS FILE
+# PLEASE MAKE CHANGES ON CORRESPONDING CUSTOM CONFIG FILE
+
 ; App name that shows on every page title
 APP_NAME = Gogs: Go Git Service
 ; Change it if you run locally
@@ -9,12 +12,18 @@ RUN_MODE = dev
 ROOT = /srv/gogs/repo
 SCRIPT_TYPE = bash
 
+[ui]
+; Number of issues that are showed in one page
+ISSUE_PAGING_NUM = 10
+
 [server]
 PROTOCOL = http
 DOMAIN = localhost
 ROOT_URL = %(PROTOCOL)s://%(DOMAIN)s:%(HTTP_PORT)s/
 HTTP_ADDR =
 HTTP_PORT = 3000
+; Disable SSH feature when not available
+DISABLE_SSH = false
 SSH_PORT = 22
 ; Disable CDN even in "prod" mode
 OFFLINE_MODE = false
@@ -77,13 +86,17 @@ ENABLE_CACHE_AVATAR = false
 ENABLE_NOTIFY_MAIL = false
 ; More detail: https://github.com/gogits/gogs/issues/165
 ENABLE_REVERSE_PROXY_AUTHENTICATION = false
-ENABLE_REVERSE_PROXY_AUTO_REGISTERATION = false
+ENABLE_REVERSE_PROXY_AUTO_REGISTRATION = false
+; Do not check minimum key size with corresponding type
+DISABLE_MINIMUM_KEY_SIZE_CHECK = false
 
 [webhook]
-; Cron task interval in minutes
-TASK_INTERVAL = 1
+; Hook task queue length
+QUEUE_LENGTH = 1000
 ; Deliver timeout in seconds
 DELIVER_TIMEOUT = 5
+; Allow insecure certification
+SKIP_TLS_VERIFY = false
 
 [mailer]
 ENABLED = false
@@ -95,10 +108,18 @@ SUBJECT = %(APP_NAME)s
 ; Gmail: smtp.gmail.com:587
 ; QQ: smtp.qq.com:25
 ; Note, if the port ends with "465", SMTPS will be used. Using STARTTLS on port 587 is recommended per RFC 6409. If the server supports STARTTLS it will always be used.
-HOST =
+HOST = 
+; Disable HELO operation when hostname are different.
+DISABLE_HELO = 
+; Custom hostname for HELO operation, default is from system.
+HELO_HOSTNAME = 
 ; Do not verify the certificate of the server. Only use this for self-signed certificates
 SKIP_VERIFY = 
-; Mail from address, RFC 5322. This can be just an email address, or the "Name" <email@example.com> format 
+; Use client certificate
+USE_CERTIFICATE = false
+CERT_FILE = custom/mailer/cert.pem
+KEY_FILE = custom/mailer/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
 USER =
@@ -148,7 +169,7 @@ ADAPTER = memory
 ; For "memory" only, GC interval in seconds, default is 60
 INTERVAL = 60
 ; For "redis" and "memcache", connection host address
-; redis: `:6039`
+; redis: network=tcp,addr=:6379,password=macaron,db=0,pool_size=100,idle_timeout=180
 ; memcache: `127.0.0.1:11211`
 HOST =
 
@@ -158,7 +179,7 @@ PROVIDER = memory
 ; Provider config options
 ; memory: not have any config yet
 ; file: session file path, e.g. `data/sessions`
-; redis: config like redis server addr, poolSize, password, e.g. `127.0.0.1:6379,100,gogs`
+; 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 = /srv/gogs/sessions
 ; Session cookie name
@@ -177,6 +198,7 @@ SESSION_LIFE_TIME = 86400
 SERVICE = server
 AVATAR_UPLOAD_PATH = /srv/gogs/data/avatars
 ; Chinese users can choose "duoshuo"
+; or a custom avatar source, like: http://cn.gravatar.com/avatar/
 GRAVATAR_SOURCE = gravatar
 DISABLE_GRAVATAR = false
 
@@ -190,7 +212,7 @@ ALLOWED_TYPES = image/jpeg|image/png
 ; Max size of each file. Defaults to 32MB
 MAX_SIZE = 32
 ; Max number of files per upload. Defaults to 10
-MAX_FILES = 10
+MAX_FILES = 5
 
 [time]
 ; Specifies the format for fully outputed dates. Defaults to RFC1123
@@ -259,15 +281,54 @@ DRIVER =
 ; Based on xorm, e.g.: root:root@localhost/gogs?charset=utf8
 CONN =
 
-[git]
-MAX_GITDIFF_LINES = 10000
+[cron]
+; Enable running cron tasks periodically.
+ENABLED = true
+; Run cron tasks when Gogs starts.
+RUN_AT_START = false
+
+; Update mirrors
+[cron.update_mirrors]
+SCHEDULE = @every 1h
+
+; Repository health check
+[cron.repo_health_check]
+SCHEDULE = @every 24h
 ; Arguments for command 'git fsck', e.g.: "--unreachable --tags"
 ; see more on http://git-scm.com/docs/git-fsck/1.7.5
-FSCK_ARGS = 
+ARGS = 
+
+; Check repository statistics
+[cron.check_repo_stats]
+RUN_AT_START = true
+SCHEDULE = @every 24h
+
+[git]
+MAX_GIT_DIFF_LINES = 10000
 ; Arguments for command 'git gc', e.g.: "--aggressive --auto"
 ; see more on http://git-scm.com/docs/git-gc/1.7.5
 GC_ARGS = 
 
 [i18n]
-LANGS = en-US,zh-CN,zh-HK,de-DE,fr-CA,nl-NL,lv-LV
-NAMES = English,简体中文,繁體中文,Deutsch,Français,Nederlands,Latviešu
+LANGS = en-US,zh-CN,zh-HK,de-DE,fr-FR,nl-NL,lv-LV,ru-RU,ja-JP,es-ES,pt-BR,pl-PL,bg-BG,it-IT
+NAMES = English,简体中文,繁體中文,Deutsch,Français,Nederlands,Latviešu,Русский,日本語,Español,Português do Brasil,Polski,български,Italiano
+
+; Used for datetimepicker
+[i18n.datelang]
+en-US = en
+zh-CN = zh
+zh-HK = zh-TW
+de-DE = de
+fr-FR = fr
+nl-NL = nl
+lv-LV = lv
+ru-RU = ru
+ja-JP = ja
+es-ES = es
+pt-BR = pt-BR
+pl-PL = pl
+bg-BG = bg
+it-IT = it
+
+[other]
+SHOW_FOOTER_BRANDING = false

+ 74 - 13
app_old.ini

@@ -1,3 +1,6 @@
+# NEVER EVER MODIFY THIS FILE
+# PLEASE MAKE CHANGES ON CORRESPONDING CUSTOM CONFIG FILE
+
 ; App name that shows on every page title
 APP_NAME = Gogs: Go Git Service
 ; Change it if you run locally
@@ -9,12 +12,18 @@ RUN_MODE = dev
 ROOT =
 SCRIPT_TYPE = bash
 
+[ui]
+; Number of issues that are showed in one page
+ISSUE_PAGING_NUM = 10
+
 [server]
 PROTOCOL = http
 DOMAIN = localhost
 ROOT_URL = %(PROTOCOL)s://%(DOMAIN)s:%(HTTP_PORT)s/
 HTTP_ADDR =
 HTTP_PORT = 3000
+; Disable SSH feature when not available
+DISABLE_SSH = false
 SSH_PORT = 22
 ; Disable CDN even in "prod" mode
 OFFLINE_MODE = false
@@ -77,13 +86,17 @@ ENABLE_CACHE_AVATAR = false
 ENABLE_NOTIFY_MAIL = false
 ; More detail: https://github.com/gogits/gogs/issues/165
 ENABLE_REVERSE_PROXY_AUTHENTICATION = false
-ENABLE_REVERSE_PROXY_AUTO_REGISTERATION = false
+ENABLE_REVERSE_PROXY_AUTO_REGISTRATION = false
+; Do not check minimum key size with corresponding type
+DISABLE_MINIMUM_KEY_SIZE_CHECK = false
 
 [webhook]
-; Cron task interval in minutes
-TASK_INTERVAL = 1
+; Hook task queue length
+QUEUE_LENGTH = 1000
 ; Deliver timeout in seconds
 DELIVER_TIMEOUT = 5
+; Allow insecure certification
+SKIP_TLS_VERIFY = false
 
 [mailer]
 ENABLED = false
@@ -95,10 +108,18 @@ SUBJECT = %(APP_NAME)s
 ; Gmail: smtp.gmail.com:587
 ; QQ: smtp.qq.com:25
 ; Note, if the port ends with "465", SMTPS will be used. Using STARTTLS on port 587 is recommended per RFC 6409. If the server supports STARTTLS it will always be used.
-HOST =
+HOST = 
+; Disable HELO operation when hostname are different.
+DISABLE_HELO = 
+; Custom hostname for HELO operation, default is from system.
+HELO_HOSTNAME = 
 ; Do not verify the certificate of the server. Only use this for self-signed certificates
 SKIP_VERIFY = 
-; Mail from address, RFC 5322. This can be just an email address, or the "Name" <email@example.com> format 
+; Use client certificate
+USE_CERTIFICATE = false
+CERT_FILE = custom/mailer/cert.pem
+KEY_FILE = custom/mailer/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
 USER =
@@ -148,7 +169,7 @@ ADAPTER = memory
 ; For "memory" only, GC interval in seconds, default is 60
 INTERVAL = 60
 ; For "redis" and "memcache", connection host address
-; redis: `:6039`
+; redis: network=tcp,addr=:6379,password=macaron,db=0,pool_size=100,idle_timeout=180
 ; memcache: `127.0.0.1:11211`
 HOST =
 
@@ -158,7 +179,7 @@ PROVIDER = memory
 ; Provider config options
 ; memory: not have any config yet
 ; file: session file path, e.g. `data/sessions`
-; redis: config like redis server addr, poolSize, password, e.g. `127.0.0.1:6379,100,gogs`
+; 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
 ; Session cookie name
@@ -177,6 +198,7 @@ SESSION_LIFE_TIME = 86400
 SERVICE = server
 AVATAR_UPLOAD_PATH = data/avatars
 ; Chinese users can choose "duoshuo"
+; or a custom avatar source, like: http://cn.gravatar.com/avatar/
 GRAVATAR_SOURCE = gravatar
 DISABLE_GRAVATAR = false
 
@@ -190,7 +212,7 @@ ALLOWED_TYPES = image/jpeg|image/png
 ; Max size of each file. Defaults to 32MB
 MAX_SIZE = 32
 ; Max number of files per upload. Defaults to 10
-MAX_FILES = 10
+MAX_FILES = 5
 
 [time]
 ; Specifies the format for fully outputed dates. Defaults to RFC1123
@@ -259,15 +281,54 @@ DRIVER =
 ; Based on xorm, e.g.: root:root@localhost/gogs?charset=utf8
 CONN =
 
-[git]
-MAX_GITDIFF_LINES = 10000
+[cron]
+; Enable running cron tasks periodically.
+ENABLED = true
+; Run cron tasks when Gogs starts.
+RUN_AT_START = false
+
+; Update mirrors
+[cron.update_mirrors]
+SCHEDULE = @every 1h
+
+; Repository health check
+[cron.repo_health_check]
+SCHEDULE = @every 24h
 ; Arguments for command 'git fsck', e.g.: "--unreachable --tags"
 ; see more on http://git-scm.com/docs/git-fsck/1.7.5
-FSCK_ARGS = 
+ARGS = 
+
+; Check repository statistics
+[cron.check_repo_stats]
+RUN_AT_START = true
+SCHEDULE = @every 24h
+
+[git]
+MAX_GIT_DIFF_LINES = 10000
 ; Arguments for command 'git gc', e.g.: "--aggressive --auto"
 ; see more on http://git-scm.com/docs/git-gc/1.7.5
 GC_ARGS = 
 
 [i18n]
-LANGS = en-US,zh-CN,zh-HK,de-DE,fr-CA,nl-NL,lv-LV
-NAMES = English,简体中文,繁體中文,Deutsch,Français,Nederlands,Latviešu
+LANGS = en-US,zh-CN,zh-HK,de-DE,fr-FR,nl-NL,lv-LV,ru-RU,ja-JP,es-ES,pt-BR,pl-PL,bg-BG,it-IT
+NAMES = English,简体中文,繁體中文,Deutsch,Français,Nederlands,Latviešu,Русский,日本語,Español,Português do Brasil,Polski,български,Italiano
+
+; Used for datetimepicker
+[i18n.datelang]
+en-US = en
+zh-CN = zh
+zh-HK = zh-TW
+de-DE = de
+fr-FR = fr
+nl-NL = nl
+lv-LV = lv
+ru-RU = ru
+ja-JP = ja
+es-ES = es
+pt-BR = pt-BR
+pl-PL = pl
+bg-BG = bg
+it-IT = it
+
+[other]
+SHOW_FOOTER_BRANDING = false

+ 1 - 1
gogs.service

@@ -7,7 +7,7 @@ After=network.target
 Type=simple
 User=gogs
 Group=gogs
-ExecStart=/usr/share/gogs/start.sh
+ExecStart=/usr/share/gogs/gogs web --config /srv/gogs/conf/app.ini
 WorkingDirectory=/usr/share/gogs/
 
 [Install]

+ 21 - 3
helper.sh

@@ -10,6 +10,9 @@ function go_get {
   elif [[ $1 == code.google.com* ]]
   then 
     get_hg $1 $2 $3
+  elif [[ $1 == golang.org* ]]
+  then 
+    get_golang $1 $2 $3
   else
     go get $1
   fi
@@ -23,14 +26,14 @@ function get_git {
   if [[ $3 != "master" ]] && [[ ${3:0} == commit* ]]
   then
     cd $2
-    git checkout ${3:7}
+    git checkout -q ${3:7}
   elif [[ $3 != "master" ]] && [[ ${3:0} == tag* ]]
   then
     cd $2
-    git checkout tags/${3:4}
+    git checkout -q tags/${3:4}
   else
     cd $2
-    git checkout ${3:7}
+    git checkout -q ${3:7}
   fi
 }
 
@@ -46,6 +49,21 @@ function get_hg {
   fi
 }
 
+function get_golang {
+  if [[ $1 == "golang.org/x/net" ]]
+  then
+    echo $1 $2 $3
+    get_git "github.com/golang/net" $2
+  elif [[ $1 == "golang.org/x/text" ]]
+  then
+    echo $1 $2 $3
+    get_git "github.com/golang/text" $2
+  else
+    echo $1 $2 $3
+  fi
+
+}
+
 # Read the .gopmfile file and clone the branch/commits of the depends
 # $1 = .gopmfile file path
 # $2 = target directory path

+ 0 - 4
start.sh

@@ -1,4 +0,0 @@
-#!/bin/bash
-
-export GOGS_CUSTOM="/srv/gogs"
-/usr/share/gogs/gogs web