commit 82fe3c1b4f578690a49ca4712f4abbfc2cf05220 Author: Andrey Astafyev Date: Wed Dec 8 17:00:00 2021 +0300 Начало проекта diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..9b5a5e8 --- /dev/null +++ b/CMakeLists.txt @@ -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}") + diff --git a/bin/myx-dev-git-init b/bin/myx-dev-git-init new file mode 100755 index 0000000..fe7a45d --- /dev/null +++ b/bin/myx-dev-git-init @@ -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 + diff --git a/build_deb.sh b/build_deb.sh new file mode 100755 index 0000000..f3ef242 --- /dev/null +++ b/build_deb.sh @@ -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 + diff --git a/debian/changelog b/debian/changelog new file mode 100644 index 0000000..a5d6e82 --- /dev/null +++ b/debian/changelog @@ -0,0 +1,6 @@ +myx-dev (0.1.0-1) unstable; urgency=medium + + * New version. + + -- Andrey Astafyev Wed, 08 Dec 2021 14:23:03 +0300 + diff --git a/debian/compat b/debian/compat new file mode 100644 index 0000000..ec63514 --- /dev/null +++ b/debian/compat @@ -0,0 +1 @@ +9 diff --git a/debian/control b/debian/control new file mode 100644 index 0000000..781c5b9 --- /dev/null +++ b/debian/control @@ -0,0 +1,15 @@ +Source: myx-dev +Section: utils +Priority: optional +Maintainer: Andrey Astafyev +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 + diff --git a/debian/rules b/debian/rules new file mode 100755 index 0000000..050e29a --- /dev/null +++ b/debian/rules @@ -0,0 +1,4 @@ +#!/usr/bin/make -f + +%: + dh $@ --buildsystem=cmake diff --git a/debian/source/format b/debian/source/format new file mode 100644 index 0000000..163aaf8 --- /dev/null +++ b/debian/source/format @@ -0,0 +1 @@ +3.0 (quilt) diff --git a/debian/source/options b/debian/source/options new file mode 100644 index 0000000..37913d1 --- /dev/null +++ b/debian/source/options @@ -0,0 +1,4 @@ +compression = "xz" +compression-level = 9 +extend-diff-ignore = "(^l10n\/.*ts)$" +