Начало проекта
This commit is contained in:
commit
82fe3c1b4f
6
CMakeLists.txt
Normal file
6
CMakeLists.txt
Normal file
@ -0,0 +1,6 @@
|
||||
cmake_minimum_required(VERSION 3.0)
|
||||
project(myx-dev VERSION 0.1.2)
|
||||
|
||||
include(GNUInstallDirs)
|
||||
install(DIRECTORY bin/ DESTINATION "${CMAKE_INSTALL_BINDIR}")
|
||||
|
81
bin/myx-dev-git-init
Executable file
81
bin/myx-dev-git-init
Executable file
@ -0,0 +1,81 @@
|
||||
#!/bin/bash
|
||||
|
||||
while [[ $# -gt 0 ]]; do
|
||||
key="$1"
|
||||
|
||||
case $key in
|
||||
-s|--server)
|
||||
SERVER="$2"
|
||||
shift # past argument
|
||||
shift # past value
|
||||
;;
|
||||
-d|--dir|--directory)
|
||||
DIRECTORY="$2"
|
||||
shift # past argument
|
||||
shift # past value
|
||||
;;
|
||||
*) # unknown option
|
||||
DIRECTORY="$1"
|
||||
break
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
[[ -z "$DIRECTORY" ]] && DIRECTORY="$(pwd)"
|
||||
if [[ -d "${DIRECTORY}/.git" ]]; then
|
||||
echo "Directory already has repository. Exiting"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
[[ -z "${SERVER}" ]] && SERVER=gitlab.2
|
||||
|
||||
TYPE=gitea
|
||||
[[ "${SERVER}" == *"gitlab"* ]] && TYPE=gitlab
|
||||
|
||||
if [[ "$TYPE" == "gitea" ]]; then
|
||||
BASE_URL="https://${SERVER}"
|
||||
BRANCH_API="raw/branch"
|
||||
GITHOOKS_ARCHIVE="archive/master.tar.gz"
|
||||
fi
|
||||
|
||||
if [[ "$TYPE" == "gitlab" ]]; then
|
||||
BASE_URL="http://${SERVER}"
|
||||
BRANCH_API="-/raw"
|
||||
GITHOOKS_ARCHIVE="-/archive/master/githooks-master.tar.gz"
|
||||
fi
|
||||
|
||||
if ! mkdir -p "$DIRECTORY"; then
|
||||
echo "Can't create directory for git repository"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
pushd "$DIRECTORY" >/dev/null
|
||||
|
||||
if ! git init; then
|
||||
echo "Can't create git repository in directory $DIRECTORY"
|
||||
exit 1
|
||||
fi
|
||||
mkdir -p files/{etc,log,share,var}
|
||||
touch files/{etc,log,share,var}/.gitkeep
|
||||
|
||||
wget "${BASE_URL}/f1x1t/cmake-format/${BRANCH_API}/master/.cmake-format.py"
|
||||
wget "${BASE_URL}/f1x1t/cmlib-gitignore/${BRANCH_API}/master/.gitignore"
|
||||
wget "${BASE_URL}/f1x1t/gitlab-ci/${BRANCH_API}/master/.gitlab-ci.yml"
|
||||
wget -o files/etc/uncrustify.cfg "${BASE_URL}/f1x1t/uncrustify-config/${BRANCH_API}/master/default.cfg"
|
||||
wget -O - "${BASE_URL}/f1x1t/githooks/${GITHOOKS_ARCHIVE}" | tar zx --strip-components=1 -C .git/hooks
|
||||
|
||||
sed -i '/.*_CMD.*/d' .gitlab-ci.yml
|
||||
sed -i '/.*variables:.*/d' .gitlab-ci.yml
|
||||
sed -i 's/^UNCRUST_CONFIG.*/UNCRUST_CONFIG=$REPO\/files\/etc\/uncrustify.cfg/' .git/hooks/pre-commit-uncrustify.cfg
|
||||
|
||||
git add .cmake-format.py .gitignore .gitlab-ci.yml files
|
||||
git commit -m "Начало проекта"
|
||||
|
||||
if [ -e .gitmodules ]; then
|
||||
sed -i 's/git@${SERVER}:/..\/..\//' .gitmodules
|
||||
git submodule sync --recursive
|
||||
git commit -m "Относительные пути к подмодулям" .gitmodules
|
||||
fi
|
||||
|
||||
popd >/dev/null
|
||||
|
17
build_deb.sh
Executable file
17
build_deb.sh
Executable file
@ -0,0 +1,17 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
V=$(grep -i "project.*VERSION" CMakeLists.txt | sed 's/.* \([0-9.]*\).*)/\1/')
|
||||
D=$(mktemp -d "/tmp/myx-dev.XXXXXX")
|
||||
mkdir -p "$D/myx-dev-$V"
|
||||
cp -ap CMakeLists.txt bin "$D/myx-dev-$V"
|
||||
pushd "$D"
|
||||
tar Jcf "myx-dev_${V}.orig.tar.xz" "myx-dev-$V"
|
||||
popd
|
||||
cp -ap debian "$D/myx-dev-$V"
|
||||
pushd "$D/myx-dev-$V"
|
||||
dch -D unstable -v "${V}-1" -m "New version."
|
||||
debuild
|
||||
popd
|
||||
|
6
debian/changelog
vendored
Normal file
6
debian/changelog
vendored
Normal file
@ -0,0 +1,6 @@
|
||||
myx-dev (0.1.0-1) unstable; urgency=medium
|
||||
|
||||
* New version.
|
||||
|
||||
-- Andrey Astafyev <dpkg@246060.ru> Wed, 08 Dec 2021 14:23:03 +0300
|
||||
|
1
debian/compat
vendored
Normal file
1
debian/compat
vendored
Normal file
@ -0,0 +1 @@
|
||||
9
|
15
debian/control
vendored
Normal file
15
debian/control
vendored
Normal file
@ -0,0 +1,15 @@
|
||||
Source: myx-dev
|
||||
Section: utils
|
||||
Priority: optional
|
||||
Maintainer: Andrey Astafyev <dev@246060.ru>
|
||||
Build-Depends: debhelper (>= 9), cmake
|
||||
Standards-Version: 4.2.0
|
||||
|
||||
Package: myx-dev
|
||||
Architecture: all
|
||||
Section: utils
|
||||
Depends: git, git-lfs
|
||||
Recommends: build-essential, cmake, cmake-format, dos2unix, libdistro-info-perl
|
||||
Description: Mixed development scripts
|
||||
Mixed development scripts
|
||||
|
4
debian/rules
vendored
Executable file
4
debian/rules
vendored
Executable file
@ -0,0 +1,4 @@
|
||||
#!/usr/bin/make -f
|
||||
|
||||
%:
|
||||
dh $@ --buildsystem=cmake
|
1
debian/source/format
vendored
Normal file
1
debian/source/format
vendored
Normal file
@ -0,0 +1 @@
|
||||
3.0 (quilt)
|
4
debian/source/options
vendored
Normal file
4
debian/source/options
vendored
Normal file
@ -0,0 +1,4 @@
|
||||
compression = "xz"
|
||||
compression-level = 9
|
||||
extend-diff-ignore = "(^l10n\/.*ts)$"
|
||||
|
Loading…
Reference in New Issue
Block a user