From fe66394cdc74a02fc9f48efce6400920587ff479 Mon Sep 17 00:00:00 2001 From: Cyteen May Date: Sat, 15 Feb 2020 13:12:13 +0000 Subject: [PATCH] Cleanup before push. --- 010_alsa.sh | 6 ++-- 010_generate-ssh.sh | 7 +++++ 020_bluez-alsa.sh | 60 +++++++++++++++++++++++++++++----------- 020_git-lfs.sh | 2 +- 020_hexchat.sh | 18 ++++++------ 020_mutt-notmuch-afew.sh | 0 020_mutt-notmuch.sh | 1 + 020_neovim.sh | 4 +-- 020_vim.sh | 38 ++++++++++++------------- 020_zfs-znapzend.sh | 2 +- 020_zsh.sh | 25 +++++++++++++---- 020_zsh_quickstart.sh | 1 + 12 files changed, 108 insertions(+), 56 deletions(-) create mode 100755 010_generate-ssh.sh mode change 100644 => 100755 020_mutt-notmuch-afew.sh diff --git a/010_alsa.sh b/010_alsa.sh index 049e472..be92d38 100755 --- a/010_alsa.sh +++ b/010_alsa.sh @@ -5,8 +5,8 @@ kill -9 `ps aux | grep -v grep | grep start-pulseaudio | awk {'print $2'}` kill -9 `ps aux | grep -v grep | grep pulseaudio | awk {'print $2'}` bash -c "rm /etc/asound.conf" -rm ~/.pulse-cookie -rm -r ~/.config/pulse +rm $HOME/.pulse-cookie +rm -r $HOME/.config/pulse rm -rf /tmp/pulse* apt-get -y install alsa-tools alsa-tools-gui alsa-utils alsa-oss alsamixergui volumeicon-alsa libalsaplayer0 @@ -15,7 +15,7 @@ apt-get -y install pnmixer /etc/init.d/alsa-utils restart kill -HUP `ps aux | grep -v grep | grep pnmixer | awk {'print $2'}` -sed -i 's,^\(VolumeControlCommand=\).*,\1'xfce4-mixer',' ~/.config/pnmixer/config +sed -i 's,^\(VolumeControlCommand=\).*,\1'xfce4-mixer',' $HOME/.config/pnmixer/config pnmixer & cat > /etc/udev/rules.d/00_alsa-usb.rules << 'EOF' diff --git a/010_generate-ssh.sh b/010_generate-ssh.sh new file mode 100755 index 0000000..dc1047c --- /dev/null +++ b/010_generate-ssh.sh @@ -0,0 +1,7 @@ +#!/usr/bin/env bash + +# System keys +ssh-keygen -A + +# Root user keys +ssh-keygen -q -t rsa -N '' -f ~/.ssh/id_rsa 2>/dev/null <<< y >/dev/null diff --git a/020_bluez-alsa.sh b/020_bluez-alsa.sh index 0973fc5..31f5dee 100755 --- a/020_bluez-alsa.sh +++ b/020_bluez-alsa.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash set -x -sudo apt-get install \ +sudo apt-get -y install \ dh-autoreconf \ dh-make \ check \ @@ -28,25 +28,31 @@ sudo apt-get install \ USER=Arkq PROJECT=bluez-alsa LICENSE=mit +SECTION=admin +HOMEPAGE=http://www.bluez.org BUILD_HOME=/var/tmp/bluez-alsa-git_build -VERSION=2.1.0 -#VERSION=$(curl "https://api.github.com/repos/${PROJECT}/tags?per_page=5" | jq -r '.[0] | .name') - +#VERSION=2.1.0 +PACKAGE=bluealsa +VERSION=$(curl "https://api.github.com/repos/${USER}/${PROJECT}/tags?per_page=5" | jq -r '.[0] | .name') +VERSION=${VERSION:1} # strip the preceding 'v' DEBEMAIL="person@company.tld" DEBFULLNAME="Testy McTester" +DESCRIPTION="Integration between BlueZ and ALSA." +LONG_DESCRIPTION=" With BlueALSA one can achieve the same goal as with PulseAudio, but with fewer\n dependencies and less overhead. BlueALSA registers all known Bluetooth audio\n profiles in BlueZ, so in theory every Bluetooth audio device can be connected.\n In order to access the audio stream, one has to connect to the ALSA PCM device\n called bluealsa." -# Disable discoverable timeout -sed -i 's,^\(DiscoverableTimeout =\).*,\1'\"0"',' /etc/default/bluetooth/main.conf - +# Disable discoverable timeout in the main.conf from the bluez package +sed -i 's,^\(DiscoverableTimeout = \).*,\1'\"0\"',' /etc/bluetooth/main.conf + +# Make the BUILD_HOME directory and clone upstream mkdir -p ${BUILD_HOME} cd ${BUILD_HOME} -git clone https://github.com/${USER}/${PROJECT}.git +git clone https://github.com/${USER}/${PROJECT}.git ${PACKAGE}-${VERSION} + +cd ${PACKAGE}-${VERSION} + +mkdir -p m4 -mv bluez-alsa bluez-alsa-git-${VERSION} -cd bluez-alsa-git-${VERSION} -pwd -ls -lh cat < .git/gbp.conf [DEFAULT] @@ -54,21 +60,39 @@ cat < .git/gbp.conf upstream-branch=master EOF +# debianize the BUILD_HOME directory +echo ${DEBFULLNAME} dh_make \ --createorig \ --single \ --native \ --copyright ${LICENSE} \ - --packagename ${PROJECT}-git \ --yes + + + +# Customize the debian directory values +#sed -i 's,^\(Description: \).*,\1'${DESCRIPTION}',' debian/control +sed -i "s,^\(Description: \).*,\1${DESCRIPTION}," debian/control +sed -i 's,^\(Section: \).*,\1'${SECTION}',' debian/control +sed -i "s,^\(Maintainer: \).*,\1'${DEBFULLNAME}\ \<${DEBEMAIL}\>'," debian/control +sed -i 's,^\(Homepage: \).*,\1'${HOMEPAGE}',' debian/control +sed -i "s/.*insert\ long.*/${LONG_DESCRIPTION}/" debian/control + + +echo **************** +cat debian/control +echo **************** + BUILD_OPTIONS="--enable-aac --enable-ofono --enable-debug" cat < debian/rules +#!/usr/bin/make -f %: dh \$@ override_dh_auto_configure: - dh_auto_configure -- ${BUILD_OPTIONS} + dh_auto_configure -- ${BUILD_OPTIONS} EOF cat < debian/watch @@ -77,9 +101,13 @@ opts=filenamemangle=s/.+\/v?(\d\S+)\.tar\.gz/${PROJECT}-$1\.tar\.gz/ \ https://github.com/${USER}/${PROJECT}/tags .*/v?(\d\S+)\.tar\.gz EOF -pwd dpkg-buildpackage -us -uc -b -sudo dpkg -i ../bluez-alsa-git_2.1.0_amd64.deb + +echo ${PACKAGE}_${VERSION}_amd64.deb + +sudo dpkg -i ../${PACKAGE}_${VERSION}_amd64.deb + +#------------------------------------------------------------------------------- ## When BlueALSA has been created, then you can start BlueALSA as background task: #bluealsa --disable-hfp & diff --git a/020_git-lfs.sh b/020_git-lfs.sh index e2bc864..a7d9e54 100755 --- a/020_git-lfs.sh +++ b/020_git-lfs.sh @@ -34,7 +34,7 @@ deb https://packagecloud.io/github/git-lfs/${OS}/ ${DIST} main deb-src https://packagecloud.io/github/git-lfs/${OS}/ ${DIST} main EOF -ln -sf ${DEST}/git-lfs.list ${LINK}/git-lfs.list +ln -sfr ${DEST}/git-lfs.list ${LINK}/git-lfs.list gpg_key_url="https://packagecloud.io/github/git-lfs/gpgkey" diff --git a/020_hexchat.sh b/020_hexchat.sh index 74b54ec..177123f 100755 --- a/020_hexchat.sh +++ b/020_hexchat.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash apt-get -y install hexchat -mkdir -p ~/.config/hexchat -cat > ~/.config/hexchat/chanopt.conf <<'EOF' +mkdir -p $HOME/.config/hexchat +cat > $HOME/.config/hexchat/chanopt.conf <<'EOF' network = freenode channel = #devuan text_hidejoinpart = 1 @@ -20,8 +20,8 @@ text_hidejoinpart = 1 EOF -mkdir -p ~/.config/hexchat/ -cat > ~/.config/hexchat/servlist.conf << 'EOF' +mkdir -p $HOME/.config/hexchat/ +cat > $HOME/.config/hexchat/servlist.conf << 'EOF' v=2.10.1 N=2600net @@ -744,7 +744,7 @@ S=irc.xertion.org/+6697 S=irc.xertion.org EOF -cat > ~/.config/hexchat/hexchat.conf <<'EOF' +cat > $HOME/.config/hexchat/hexchat.conf <<'EOF' version = 2.10.1 away_auto_unmark = 0 away_omit_alerts = 0 @@ -762,7 +762,7 @@ dcc_auto_recv = 1 dcc_auto_resume = 1 dcc_blocksize = 1024 dcc_completed_dir = -dcc_dir = ~/Downloads +dcc_dir = $HOME/Downloads dcc_fast_send = 1 dcc_global_max_get_cps = 0 dcc_global_max_send_cps = 0 @@ -957,6 +957,6 @@ url_grabber_limit = 100 url_logging = 0 EOF -#bash -c `perl -p -i -e 's/irc_conf_mode =.""/irc_conf_mode = "1"/g' ~/.xchat2/xchat.conf` -#bash -c `perl -p -i -e 's/irc_conf_mode =.""/irc_conf_mode = "1"/g' ~/.config/hexchat/h/xchat.conf` -perl -p -i -e 's/irc_conf_mode =.""/irc_conf_mode = "1"/g' ~/.config/hexchat/hexchat.conf +#bash -c `perl -p -i -e 's/irc_conf_mode =.""/irc_conf_mode = "1"/g' $HOME/.xchat2/xchat.conf` +#bash -c `perl -p -i -e 's/irc_conf_mode =.""/irc_conf_mode = "1"/g' $HOME/.config/hexchat/h/xchat.conf` +perl -p -i -e 's/irc_conf_mode =.""/irc_conf_mode = "1"/g' $HOME/.config/hexchat/hexchat.conf diff --git a/020_mutt-notmuch-afew.sh b/020_mutt-notmuch-afew.sh old mode 100644 new mode 100755 diff --git a/020_mutt-notmuch.sh b/020_mutt-notmuch.sh index 6019f18..21a1597 100644 --- a/020_mutt-notmuch.sh +++ b/020_mutt-notmuch.sh @@ -1,3 +1,4 @@ +#!/usr/bin/env bash #FIXME: Install notmuch mail indexer for mutt NOT TESTED YET # NB the following macro is already in mutt-wizard.muttrc diff --git a/020_neovim.sh b/020_neovim.sh index 8294725..f2c3358 100755 --- a/020_neovim.sh +++ b/020_neovim.sh @@ -12,14 +12,14 @@ apt-get install -y #python-neovim python3-neovim -#ln -s ~/.vim ~/.config/nvim +#ln -sfr ~/.vim ~/.config/nvim mkdir -p ~/.config/nvim mkdir -p ~/.config/nvim/bundle mkdir -p ~/.config/nvim/colors git clone https://github.com/VundleVim/Vundle.vim.git ~/.config/nvim/bundle/Vundle.vim # https://github.com/Netherdrake/Dotfiles/blob/master/config/nvim/init.vim -#ln -s ~/.vimrc ~/.config/nvim/init.vim +#ln -sfr ~/.vimrc ~/.config/nvim/init.vim # wget -c --directory-prefix ~/.config/nvim https://raw.githubusercontent.com/Netherdrake/Dotfiles/master/config/nvim/init.vim cat > ~/.config/nvim/init.vim << 'EOF' diff --git a/020_vim.sh b/020_vim.sh index 2dfadc0..4bbcf77 100755 --- a/020_vim.sh +++ b/020_vim.sh @@ -7,14 +7,14 @@ sed -i -e 's/"set background=dark/set background=dark/' /etc/vim/vimrc # Macros # Format json -cat > ~/.vimrc << 'EOF' +cat > $HOME/.vimrc << 'EOF' " Format json nmap =j :%!python -m json.tool EOF # vimrc additions -cat > ~/.vimrc << 'EOF' +cat > $HOME/.vimrc << 'EOF' " enable syntax highlighting syntax enable @@ -83,7 +83,7 @@ endif EOF # Xresources-hybrid-reduced-contrast -cat > ~/.Xresources << 'EOF' +cat > $HOME/.Xresources << 'EOF' ! Hybrid Terminal Colours. Uses the palette from Tomorrow-Night: ! https://github.com/chriskempson/tomorrow-theme/blob/master/vim/colors/Tomorrow-Night.vim ! and the reduced contrast background color from Codecademy's online editor: @@ -118,16 +118,16 @@ cat > ~/.Xresources << 'EOF' *color15: #C5C8C6 EOF -cd ~ || exit +cd $HOME || exit apt-get install -y git -git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim +git clone https://github.com/VundleVim/Vundle.vim.git $HOME/.vim/bundle/Vundle.vim # Prepend to the .vimrc -rm ~/.vimrc_pending -touch ~/.vimrc_pending +rm $HOME/.vimrc_pending +touch $HOME/.vimrc_pending -cat > ~/.vimrc_pending << 'EOF' +cat > $HOME/.vimrc_pending << 'EOF' set nocompatible " be iMproved, required filetype off " required @@ -136,10 +136,10 @@ set relativenumber set number " set the runtime path to include Vundle and initialize -set rtp+=~/.vim/bundle/Vundle.vim +set rtp+=$HOME/.vim/bundle/Vundle.vim call vundle#begin() " alternatively, pass a path where Vundle should install plugins -"call vundle#begin('~/some/path/here') +"call vundle#begin('$HOME/some/path/here') " let Vundle manage Vundle, required Plugin 'VundleVim/Vundle.vim' @@ -343,16 +343,16 @@ au BufRead,BufNewFile *.py,*.pyw,*.c,*.h match BadWhitespace /\s\+$/lib EOF -cat ~/.vimrc_pending +cat $HOME/.vimrc_pending # append the existing vimrc to the plugin additions -cat ~/.vimrc >> ~/.vimrc_pending +cat $HOME/.vimrc >> $HOME/.vimrc_pending # copy it back to the vimrc -cp ~/.vimrc_pending ~/.vimrc -#mv ~/.vimrc_pending ~/.vimrc +cp $HOME/.vimrc_pending $HOME/.vimrc +#mv $HOME/.vimrc_pending $HOME/.vimrc -cat ~/.vimrc +cat $HOME/.vimrc vim +PluginInstall +qall # Install YouCompleteMe support @@ -360,16 +360,16 @@ apt-get install -y build-essential cmake exuberant-ctags apt-get install -y python-dev python3-dev # semantic support for C-family -#cd ~/.vim/bundle/YouCompleteMe/ && ./install.py --clang-completer +#cd $HOME/.vim/bundle/YouCompleteMe/ && ./install.py --clang-completer # Python should work automatically -#cd ~/.vim/bundle/YouCompleteMe/ && ./install.py +#cd $HOME/.vim/bundle/YouCompleteMe/ && ./install.py # Go support - -#cd ~/.vim/bundle/YouCompleteMe/ && ./install.py --gocode-code --clang-completer +#cd $HOME/.vim/bundle/YouCompleteMe/ && ./install.py --gocode-code --clang-completer # ycmd update -#cd ~/.vim/bundle/YouCompleteMe/third_party/ycmd && git submodule update --init --recursive \ +#cd $HOME/.vim/bundle/YouCompleteMe/third_party/ycmd && git submodule update --init --recursive \ #./build.py --all # jedi-vim (since youcompleteme seems to just crash) diff --git a/020_zfs-znapzend.sh b/020_zfs-znapzend.sh index 097a2d7..cfa17f8 100755 --- a/020_zfs-znapzend.sh +++ b/020_zfs-znapzend.sh @@ -9,7 +9,7 @@ apt-get install mbuffer #cd znapzend-${ZZ_VERSION} #./configure --prefix=/opt/znapzend-${ZZ_VERSION} #make -#checkinstall --fstrans=no bash -c 'make install && for x in /opt/znapzend-0.17.0/bin/*; do ln -s $x /usr/local/bin; done' +#checkinstall --fstrans=no bash -c 'make install && for x in /opt/znapzend-0.17.0/bin/*; do ln -sf $x /usr/local/bin; done' # rm -rf znapzend-${ZZ_VERSION} diff --git a/020_zsh.sh b/020_zsh.sh index fac9cf9..83d2e2b 100755 --- a/020_zsh.sh +++ b/020_zsh.sh @@ -30,11 +30,11 @@ git clone http://github.com/tarjoilija/zgen # available with apt-get install zge mkdir -p ~/.zgen/robbyrussell/ git clone http://github.com/ohmyzsh/ohmyzsh ~/.zgen/robbyrussell/ohmyzsh -#ln -sf ~/zsh-quickstart-kit/zsh/.zshrc ~/.zshrc -#ln -sf ~/zsh-quickstart-kit/zsh/.zsh_functions ~/.zsh_functions -#ln -sf ~/zsh-quickstart-kit/zsh/.zsh_aliases ~/.zsh_aliases -#ln -sf ~/zsh-quickstart-kit/zsh/.zgen-setup ~/.zgen-setup -#ln -sf ~/zsh-quickstart-kit/zsh/.zsh_completions ~/.zsh-completions +#ln -sfr ~/zsh-quickstart-kit/zsh/.zshrc ~/.zshrc +#ln -sfr ~/zsh-quickstart-kit/zsh/.zsh_functions ~/.zsh_functions +#ln -sfr ~/zsh-quickstart-kit/zsh/.zsh_aliases ~/.zsh_aliases +#ln -sfr ~/zsh-quickstart-kit/zsh/.zgen-setup ~/.zgen-setup +#ln -sfr ~/zsh-quickstart-kit/zsh/.zsh_completions ~/.zsh-completions mkdir -p ~/.zshrc.d echo "setopt PROMPT_SUBST" >> ~/.zshrc @@ -43,6 +43,20 @@ echo "NVIM_PYTHON_LOG_FILE=/var/tmp/nvim_python.log" >> ~/.zshrc.d/008_nvim.zsh echo "NVIM_PYTHON_LOG_LEVEL=DEBUG" >> ~/.zshrc.d/008_nvim.zsh touch /var/tmp/nvim_python.log +# Fix for using urls on the commandline +cat >> ~/.zshrc.d/005-url-quote-magic.zsh < ~/.zgen-local-plugins << 'EOF' zgen oh-my-zsh plugins/rsync zgen oh-my-zsh plugins/tmux zgen oh-my-zsh plugins/screen + zgen oh-my-zsh plugins/ssh-agent zgen oh-my-zsh plugins/sudo zgen oh-my-zsh plugins/vagrant diff --git a/020_zsh_quickstart.sh b/020_zsh_quickstart.sh index 2e94a2f..8c46a58 100755 --- a/020_zsh_quickstart.sh +++ b/020_zsh_quickstart.sh @@ -125,6 +125,7 @@ cat > ~/.zgen-local-plugins << 'EOF' zgen oh-my-zsh plugins/rsync zgen oh-my-zsh plugins/tmux zgen oh-my-zsh plugins/screen + zgen oh-my-zsh plugins/ssh-agent zgen oh-my-zsh plugins/sudo zgen oh-my-zsh plugins/vagrant