-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcpp.yaml
More file actions
109 lines (99 loc) · 3.15 KB
/
cpp.yaml
File metadata and controls
109 lines (99 loc) · 3.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
fullname: C++
description: The C++ assistant will help you create a basic C++ project and install its dependencies.
dependencies:
- rpm: ['gcc-c++', 'glibc-devel', 'automake', 'autoconf', 'valgrind', 'gdb', 'strace']
dependencies_build:
- rpm: ['rpm-build','mock','rpmdevtools']
dependencies_eclipse:
- use: eclipse.dependencies_c
dependencies_vim:
- use: vim.dependencies
args:
name:
use: common_args
build:
flags:
- -b
- --build
help:
'This will create SRPM and RPM packages.'
action:
'store_true'
vim:
use: vim
eclipse:
use: eclipse
github:
use: github
files:
cppsources: &cppsources
source: .
run:
- $dirname~: $(dirname "$name")
- $basename~: $(basename "$name" | tr '[A-Z]' '[a-z]')
- log_i: "Project name will be converted to lowercase letters ($basename)"
- $lowername: $dirname/$basename
- if not $(ls "$lowername"):
- log_i: 'Copying c++ source tree to project destination'
- cl_i: cp -r *cppsources "$lowername"
- dda_c: "$lowername"
- cl: cd "$lowername"
- cl: sed -i "s|CDevelopmentTool|$basename|" configure.ac
- cl: mv cdevelopmenttool.spec "$basename.spec"
- cl: sed -i "s|cdevelopmenttool|$basename|" "$basename.spec"
- $cldate~: $(LC_ALL=C date '+%a %b %d %Y')
- $clname~: $(git config user.name)
- if not $clname:
- $clname~: $(python -c 'import pwd,posix; print pwd.getpwuid(posix.getuid()).pw_gecos')
- $clemail~: $(git config user.email)
- if not $clemail:
- $user~: $(id -un)
- $host~: $(uname -n)
- $clemail~: $(echo "$user@$host")
- cl: sed -i "s|Fri Mar 15 2013 UserName <user@host>|$cldate $clname <$clemail>|" "$basename.spec"
- use: git.init_add_commit.run
- else:
- cl: cd "$lowername"
- log_i: 'Project already exists'
- log_i: 'Run autoreconf'
- cl_i: autoreconf --install
- log_i: 'Run configure script'
- cl_i: ./configure
- cl_i: make clean
- log_i: 'Compiling sources'
- cl_i: make
- log_i: 'Run make distcheck to create a tar ball'
- cl_i: make dist
- log_i: 'The $name/README file describes how to add and build a new C++'
- log_i: 'source file using autotools'
- log_i: 'More information about autotools can be found here:'
- log_i: 'automake: http://www.gnu.org/software/automake/manual/automake.html'
- log_i: 'autoconf: http://www.gnu.org/software/autoconf/manual/autoconf.html'
- if defined $vim:
- use: vim.run
- if defined $build:
- log_i: 'Creating spec file'
- $dirname~: $(pwd)
- cl: rpmdev-setuptree
- cl: rm -f "~/rpmbuild/SPECS/$basename.spec"
- cl: cp "$basename-0.0.tar.gz" ~/rpmbuild/SOURCES
- cl: cp "$basename.spec" ~/rpmbuild/SPECS
- cl: cd ~/rpmbuild/SPECS
- $builddeps~: $(rpmspec -q --buildrequires "~/rpmbuild/SPECS/$basename.spec")
- $missingdeps:
- for $d word_in $builddeps:
- if not $(rpm -q $d):
- $missingdeps: $missingdeps $d
- if $missingdeps:
- cl_ir: yum-builddep "~/rpmbuild/SPECS/$basename.spec" -y
- log_i: 'Creating RPM from tarball'
- cl_i: rpmbuild -ba "$basename.spec"
- cl: cd "$dirname"
- if $eclipse:
- use: eclipse.run_cpp
- if defined $github:
- log_i: "Pushing to GitHub repository"
- github:
- create_and_push
- reponame: $basename
login: $github