|
|
@ -5,7 +5,7 @@ |
|
|
|
%define gitea_logdir /var/log/gitea/ |
|
|
|
%define gitea_logdir /var/log/gitea/ |
|
|
|
|
|
|
|
|
|
|
|
Name : gitea |
|
|
|
Name : gitea |
|
|
|
Version : 1.13.0 |
|
|
|
Version : 1.13.2 |
|
|
|
Release : 1%{dist} |
|
|
|
Release : 1%{dist} |
|
|
|
License : MIT |
|
|
|
License : MIT |
|
|
|
URL : http://gitea.io |
|
|
|
URL : http://gitea.io |
|
|
@ -33,31 +33,35 @@ git clone https://github.com/go-gitea/gitea |
|
|
|
export GOPATH=`pwd` |
|
|
|
export GOPATH=`pwd` |
|
|
|
cd src/github.com/go-gitea/gitea |
|
|
|
cd src/github.com/go-gitea/gitea |
|
|
|
git checkout tags/v%{version} |
|
|
|
git checkout tags/v%{version} |
|
|
|
|
|
|
|
### BACKEND - golang |
|
|
|
sed -i 's|^var Version = "1.[0-9].[0-9]-dev"$|var Version = "'%{version}'"|g' main.go |
|
|
|
sed -i 's|^var Version = "1.[0-9].[0-9]-dev"$|var Version = "'%{version}'"|g' main.go |
|
|
|
GO111MODULE=on go build -v -ldflags "-extldflags -s -w -B 0x$(head -c20 /dev/urandom|od -An -tx1|tr -d ' \n') -buildid "%{version}" -X 'main.Version="%{version}"'" |
|
|
|
GO111MODULE=on go build -v -ldflags "-extldflags -s -w -B 0x$(head -c20 /dev/urandom|od -An -tx1|tr -d ' \n') -buildid "%{version}" -X 'main.Version="%{version}"' -X 'main.MakeVersion="%{release}"'" |
|
|
|
sed -i 's|^STATIC_ROOT_PATH =$|STATIC_ROOT_PATH = /usr/share/gitea/templates/default/|g' custom/conf/app.ini.sample |
|
|
|
### FRONTEND - nodejs |
|
|
|
sed -i 's|^ROOT =$|ROOT = /var/lib/gitea/repositories/|g' custom/conf/app.ini.sample |
|
|
|
#npm install --no-save |
|
|
|
sed -i 's|^APP_DATA_PATH = data$|APP_DATA_PATH = /var/lib/gitea/data|g' custom/conf/app.ini.sample |
|
|
|
#npx eslint web_src/js webpack.config.js |
|
|
|
sed -i 's|^PROVIDER_CONFIG = data/sessions$|PROVIDER_CONFIG = /var/lib/gitea/data/sessions|g' custom/conf/app.ini.sample |
|
|
|
#npx webpack |
|
|
|
sed -i 's|^AVATAR_UPLOAD_PATH = data/avatars$|AVATAR_UPLOAD_PATH = /var/lib/gitea/data/avatars|g' custom/conf/app.ini.sample |
|
|
|
#npx lessc web_src/less/index.less public/css/index.css |
|
|
|
sed -i 's|^PATH = data/attachments$|PATH = /var/lib/gitea/data/attachments|g' custom/conf/app.ini.sample |
|
|
|
#npx lessc web_src/less/themes/theme-arc-green.less public/css/theme-arc-green.css |
|
|
|
sed -i 's|^ROOT_PATH =$|ROOT_PATH = /var/log/gitea|g' custom/conf/app.ini.sample |
|
|
|
##npx postcss --use autoprefixer --use cssnano --no-map --replace public/css/* |
|
|
|
sed -i 's|^TEMP_PATH = data/tmp/uploads$|TEMP_PATH = /var/lib/gitea/data/tmp/uploads|g' custom/conf/app.ini.sample |
|
|
|
#cp web_src/fomantic/theme.config.less node_modules/fomantic-ui/src/theme.config |
|
|
|
npm install |
|
|
|
#cp -r web_src/fomantic/_site/* node_modules/fomantic-ui/src/_site/ |
|
|
|
npx eslint web_src/js webpack.config.js |
|
|
|
#npx gulp -f node_modules/fomantic-ui/gulpfile.js build |
|
|
|
npx webpack |
|
|
|
make frontend V=1 |
|
|
|
npx lessc web_src/less/index.less public/css/index.css |
|
|
|
### CONFIG |
|
|
|
npx lessc web_src/less/themes/theme-arc-green.less public/css/theme-arc-green.css |
|
|
|
sed -i 's|^STATIC_ROOT_PATH =$|STATIC_ROOT_PATH = /usr/share/gitea/templates/default/|g' custom/conf/app.example.ini |
|
|
|
#npx postcss --use autoprefixer --use cssnano --no-map --replace public/css/* |
|
|
|
sed -i 's|^ROOT =$|ROOT = /var/lib/gitea/repositories/|g' custom/conf/app.example.ini |
|
|
|
cp web_src/fomantic/theme.config.less node_modules/fomantic-ui/src/theme.config |
|
|
|
sed -i 's|^APP_DATA_PATH = data$|APP_DATA_PATH = /var/lib/gitea/data|g' custom/conf/app.example.ini |
|
|
|
cp -r web_src/fomantic/_site/* node_modules/fomantic-ui/src/_site/ |
|
|
|
sed -i 's|^PROVIDER_CONFIG = data/sessions$|PROVIDER_CONFIG = /var/lib/gitea/data/sessions|g' custom/conf/app.example.ini |
|
|
|
npx gulp -f node_modules/fomantic-ui/gulpfile.js build |
|
|
|
sed -i 's|^AVATAR_UPLOAD_PATH = data/avatars$|AVATAR_UPLOAD_PATH = /var/lib/gitea/data/avatars|g' custom/conf/app.example.ini |
|
|
|
|
|
|
|
sed -i 's|^PATH = data/attachments$|PATH = /var/lib/gitea/data/attachments|g' custom/conf/app.example.ini |
|
|
|
|
|
|
|
sed -i 's|^ROOT_PATH =$|ROOT_PATH = /var/log/gitea|g' custom/conf/app.example.ini |
|
|
|
|
|
|
|
sed -i 's|^TEMP_PATH = data/tmp/uploads$|TEMP_PATH = /var/lib/gitea/data/tmp/uploads|g' custom/conf/app.example.ini |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
%install |
|
|
|
%install |
|
|
|
install -p -D -m 0644 %{SOURCE0} %{buildroot}%{_unitdir}/gitea.service |
|
|
|
install -p -D -m 0644 %{SOURCE0} %{buildroot}%{_unitdir}/gitea.service |
|
|
|
mkdir -p %{buildroot}/%{gitea_home}/conf/ |
|
|
|
mkdir -p %{buildroot}/%{gitea_home}/conf/ |
|
|
|
install -p -D -m 0644 src/github.com/go-gitea/gitea/custom/conf/app.ini.sample %{buildroot}%{gitea_home}/conf/app.ini |
|
|
|
install -p -D -m 0644 src/github.com/go-gitea/gitea/custom/conf/app.example.ini %{buildroot}%{gitea_home}/conf/app.ini |
|
|
|
cp -r src/github.com/go-gitea/gitea/options/locale %{buildroot}%{gitea_home}/conf/ |
|
|
|
cp -r src/github.com/go-gitea/gitea/options/locale %{buildroot}%{gitea_home}/conf/ |
|
|
|
cp -r src/github.com/go-gitea/gitea/options/license %{buildroot}%{gitea_home}/conf/ |
|
|
|
cp -r src/github.com/go-gitea/gitea/options/license %{buildroot}%{gitea_home}/conf/ |
|
|
|
cp -r src/github.com/go-gitea/gitea/options/label %{buildroot}%{gitea_home}/conf/ |
|
|
|
cp -r src/github.com/go-gitea/gitea/options/label %{buildroot}%{gitea_home}/conf/ |
|
|
|