post-scribe 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/bin/scribe +115 -0
- metadata +46 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: be01ec03c7be0e5ef83f37f42b6bb67137ac5c22
|
4
|
+
data.tar.gz: 498e25b57fe5f568a306542da60f4f54c77a517b
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: e49f181ab1ad79aa5e45c8804c23e142475d366e921b839613e35f86018552027fd331c0bc5701e58746be4bef574da55ef81045646e8921493c48c1d91fc486
|
7
|
+
data.tar.gz: e76c96259fa6a5073a495f7e7f3fcbd560dfd25fcfbde3d8b1855d1c55945c30092c75591862dda61f591f1b4f85ded71f5325eb6fbc31fd197d5fd6f7644fde
|
data/bin/scribe
ADDED
@@ -0,0 +1,115 @@
|
|
1
|
+
#!/usr/bin/ruby
|
2
|
+
# Copyright (C) Thomas Chace 2011-2014 <tchacex@gmail.com>
|
3
|
+
|
4
|
+
# Scribe is free software: you can redistribute it and/or modify
|
5
|
+
# it under the terms of the GNU Lesser General Public License as published by
|
6
|
+
# the Free Software Foundation, either version 3 of the License, or
|
7
|
+
# (at your option) any later version.
|
8
|
+
|
9
|
+
# Scribe is distributed in the hope that it will be useful,
|
10
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
11
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
12
|
+
# GNU Lesser General Public License for more details.
|
13
|
+
|
14
|
+
# You should have received a copy of the GNU General Public License
|
15
|
+
# along with Scribe. If not, see <http://www.gnu.org/licenses/>.
|
16
|
+
|
17
|
+
require("rbconfig")
|
18
|
+
require("yaml")
|
19
|
+
require("optparse")
|
20
|
+
require("fileutils")
|
21
|
+
include(FileUtils)
|
22
|
+
|
23
|
+
# This is MakePackage, our automatic package building tool.
|
24
|
+
class MakePackage
|
25
|
+
# This gets some information from the user we need.
|
26
|
+
def initialize(spec)
|
27
|
+
@file = open(spec, 'r')
|
28
|
+
@spec = YAML::load(@file)
|
29
|
+
puts("Package: #{@spec['name']}")
|
30
|
+
puts("Version: #{@spec['version']}")
|
31
|
+
puts("Description: #{@spec['description']}")
|
32
|
+
print("Are you SURE you want to continue? [y/n] ")
|
33
|
+
if gets.include?("y")
|
34
|
+
mkdir_p("#{@spec['name']}-build/data")
|
35
|
+
cp("packageData", "#{@spec['name']}-build/data/.packageData")
|
36
|
+
cp("install", "#{@spec['name']}-build/data/.install")
|
37
|
+
cp("remove", "#{@spec['name']}-build/data/.remove")
|
38
|
+
@pwd = pwd()
|
39
|
+
cd("#{@spec['name']}-build")
|
40
|
+
get()
|
41
|
+
compile()
|
42
|
+
buildpkg()
|
43
|
+
else
|
44
|
+
puts("#{@spec['name']} not built.")
|
45
|
+
end
|
46
|
+
end
|
47
|
+
# Downloads source code.
|
48
|
+
def get()
|
49
|
+
puts("Getting Source Code...")
|
50
|
+
for source in @spec['source']
|
51
|
+
if source.include?("http://") or source.include?("ftp://")
|
52
|
+
action = system("wget -c #{source}")
|
53
|
+
if action == false
|
54
|
+
puts("Could not download #{source}.")
|
55
|
+
exit(1)
|
56
|
+
end
|
57
|
+
elsif source.include?("git://")
|
58
|
+
action = system("git clone #{source}")
|
59
|
+
if action == false
|
60
|
+
puts("Could not download #{source}.")
|
61
|
+
exit(1)
|
62
|
+
end
|
63
|
+
end
|
64
|
+
end
|
65
|
+
end
|
66
|
+
# Compiles the package.
|
67
|
+
def compile()
|
68
|
+
puts("Building Software...")
|
69
|
+
build = File.read("../build")
|
70
|
+
eval(build)
|
71
|
+
cd("#{@pwd}/#{@spec['name']}-build/data")
|
72
|
+
packageFiles = Dir["**/*"].reject {|file| File.directory?(file) }
|
73
|
+
for file in packageFiles
|
74
|
+
if file.include?("/bin/") or file.include?("/lib/")
|
75
|
+
system("strip #{file}")
|
76
|
+
end
|
77
|
+
end
|
78
|
+
end
|
79
|
+
# Makes the package.
|
80
|
+
def buildpkg()
|
81
|
+
puts("Making Package...")
|
82
|
+
packageName = "#{@spec['name']}-#{@spec['version']}-#{RbConfig::CONFIG["build_cpu"]}.pst"
|
83
|
+
system("tar cf #{packageName} * .packageData .install .remove")
|
84
|
+
system("xz #{packageName}")
|
85
|
+
cp(packageName + ".xz", "#{@pwd}/#{packageName}")
|
86
|
+
rm("#{packageName}.xz")
|
87
|
+
end
|
88
|
+
end
|
89
|
+
|
90
|
+
makepkg = nil
|
91
|
+
|
92
|
+
ARGV.options do |o|
|
93
|
+
|
94
|
+
o.set_summary_indent(" ")
|
95
|
+
o.banner = "Usage: scribe [OPTIONS] [PACKAGES]"
|
96
|
+
o.version = "0.5.0"
|
97
|
+
o.define_head "Copyright (C) Thomas Chace 2011-2014 <tchacex@gmail.com>"
|
98
|
+
o.separator "Released under the GNU General Public License Version 3."
|
99
|
+
o.separator ""
|
100
|
+
|
101
|
+
o.on_tail("-m", "--makepkg",
|
102
|
+
"Make a package.") {makepkg = true}
|
103
|
+
|
104
|
+
o.on_tail("-h", "--help",
|
105
|
+
"Show this help message.") { puts o; exit }
|
106
|
+
|
107
|
+
o.on_tail("-v", "--version",
|
108
|
+
"Show version information.") { puts o.version; exit }
|
109
|
+
|
110
|
+
o.parse!
|
111
|
+
end
|
112
|
+
|
113
|
+
if (makepkg)
|
114
|
+
MakePackage.new("packageData")
|
115
|
+
end
|
metadata
ADDED
@@ -0,0 +1,46 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: post-scribe
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.5.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Thomas Chace
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2014-05-07 00:00:00.000000000 Z
|
12
|
+
dependencies: []
|
13
|
+
description: Builds and compresses packages from source on UNIX-like systems for the
|
14
|
+
Post package manager.
|
15
|
+
email: tchacex@gmail.com
|
16
|
+
executables:
|
17
|
+
- scribe
|
18
|
+
extensions: []
|
19
|
+
extra_rdoc_files: []
|
20
|
+
files:
|
21
|
+
- bin/scribe
|
22
|
+
homepage: http://github.com/thomashc/Scribe
|
23
|
+
licenses:
|
24
|
+
- GPL
|
25
|
+
metadata: {}
|
26
|
+
post_install_message:
|
27
|
+
rdoc_options: []
|
28
|
+
require_paths:
|
29
|
+
- lib
|
30
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
31
|
+
requirements:
|
32
|
+
- - '>='
|
33
|
+
- !ruby/object:Gem::Version
|
34
|
+
version: '0'
|
35
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
36
|
+
requirements:
|
37
|
+
- - '>='
|
38
|
+
- !ruby/object:Gem::Version
|
39
|
+
version: '0'
|
40
|
+
requirements: []
|
41
|
+
rubyforge_project:
|
42
|
+
rubygems_version: 2.0.3
|
43
|
+
signing_key:
|
44
|
+
specification_version: 4
|
45
|
+
summary: Source builder for the Post package manager.
|
46
|
+
test_files: []
|