photo-stats

Unnamed repository; edit this file 'description' to name the repository.
git clone git://code.clttr.info/photo-stats.git
Log | Files | Refs | README | LICENSE

commit d19321534c84aa312d8bc249a47fd068a2b0aec0
parent f8815d519bde384bb2f88c75944ba3f1c9e70eab
Author: René Wagner <rwagner@rw-net.de>
Date:   Tue, 28 Jul 2020 20:29:48 +0200

setup build and packaging

Diffstat:
A.build.yml | 22++++++++++++++++++++++
ALICENSE | 29+++++++++++++++++++++++++++++
APKGBUILD | 19+++++++++++++++++++
Aphosta.pl | 78++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
4 files changed, 148 insertions(+), 0 deletions(-)

diff --git a/.build.yml b/.build.yml @@ -0,0 +1,22 @@ +image: archlinux +packages: + - perl + - perl-par-packer + - perl-file-homedir +sources: + - https://git.sr.ht/~rwa/photo-stats +artifacts: + - photo-statsi/output.tar +tasks: + - build: | + cd photo-stats + perl -c phosta.pl + mkdir bin + /usr/bin/vendor_perl/pp -z 9 -f Bleach -o phosta phosta.pl + - package: | + TAG=`date +"%Y%m%d"` + cd photo-stats + tar -czf ${TAG}_linux_amd64.tar.gz phosta + makepkg -g + makepkg + tar -cf output.tar *.tar.gz *.tar.zst diff --git a/LICENSE b/LICENSE @@ -0,0 +1,29 @@ +BSD 3-Clause License + +Copyright (c) 2018-2020, René Wagner +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +* Neither the name of the copyright holder nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/PKGBUILD b/PKGBUILD @@ -0,0 +1,19 @@ +# Maintainer: René Wagner < rwagner at rw-net dot de > + +pkgname=photo-stats +pkgver=20200718 +pkgrel=1 +pkgdesc='photo stats for ' +arch=('x86_64') +license=('BSD') +url='https://git.sr.ht/~rwa/photo-stats' +provides=('photo-stats') +options=(!strip) +source=('phosta') +sha256sums=('SKIP') + + +package() { + mkdir -p "${pkgdir}/usr/bin" + install -Dm755 phosta "${pkgdir}/usr/bin/" +} diff --git a/phosta.pl b/phosta.pl @@ -0,0 +1,78 @@ +#!/usr/bin/perl +# Copyright(c) René Wagner 2019-2020 +# https://git.sr.ht/~rwa/photo-stats +# published under BSD 3-Clause License - https://git.sr.ht/~rwa/photo-stats/tree/master/LICENSE + +use warnings; +use strict; +use feature qw(say); +use Cwd; +use File::Basename; +use File::Copy; +use File::Find; +use File::Find::Rule; +use File::Spec::Functions; +use File::HomeDir; +use Getopt::Std; + +$Getopt::Std::STANDARD_HELP_VERSION = 'true'; + +my $VERSION = '0.1'; +my $PROGRAM = 'Photo Stats'; + +my $configfile = catfile(File::HomeDir->my_home, '.photo-stats.conf'); + +# read commandline switches +my $opt_s=0; + +getconfig($configfile); + +#getopts('slr:f:c:') or die "Invalid parameters provided! See 'art_file_mover.pl --help' for more details."; + +# read remaining commandline args for source dir +# last dir will win +my $destination_dir = getcwd; +foreach my $arg ( @ARGV ) +{ + $destination_dir = $arg; +} + +if ( $opt_s ) { writeconfig($configfile); } + +#move_files($destination_dir); + +exit 0; + +sub getconfig +{ + my ( $config_filename ) = @_; + if ( -f $config_filename ) { do $config_filename; } +} + +sub writeconfig +{ + my ( $config_filename ) = @_; + open(my $filehandle, '>', $config_filename) or die "Could not open file '$config_filename': $!"; + #say $filehandle '$opt_f="'. $opt_f .'";'; + close $filehandle; +} + +sub main::VERSION_MESSAGE() +{ + say $PROGRAM . ' - version ' . $VERSION; + say 'published under BSD 3 - Clause License'; + say 'Copyright(c) 2019-2020 René Wagner'; + say 'https://git.sr.ht/~rwa/photo-helpers'; +} + +sub main::HELP_MESSAGE +{ + say ''; + say 'Find all by ART converted files in the current folder and their corresponding RAWs and move them to specified directory.'; + say ''; + say 'usage: phosta(.pl) [options] <source folder>'; + say ''; + say 'options:'; + say ' -s : safe current options (-r, -f, -c only) to user profile. If present the saved values are applied automatically.'; + say ' --help : show this help'; +}