Skip to content
This repository was archived by the owner on Aug 20, 2020. It is now read-only.

Commit 0e221ed

Browse files
committed
added proof of concept rss2json cli
1 parent 4dbd645 commit 0e221ed

21 files changed

Lines changed: 1443 additions & 3 deletions

.gitignore

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,38 @@ _testmain.go
2222
*.exe
2323
*.test
2424
*.prof
25+
# Compiled Object files, Static and Dynamic libs (Shared Objects)
26+
*.o
27+
*.a
28+
*.so
29+
30+
# Folders
31+
_obj
32+
_test
33+
34+
# Architecture specific extensions/prefixes
35+
*.[568vq]
36+
[568vq].out
37+
38+
*.cgo1.go
39+
*.cgo2.c
40+
_cgo_defun.c
41+
_cgo_gotypes.go
42+
_cgo_export.*
43+
44+
_testmain.go
45+
46+
*.exe
47+
*.test
48+
*.prof
49+
50+
#
51+
# Project specific files
52+
#
53+
~*
54+
*~
55+
*.swp
56+
*.zip
57+
dist/*
58+
bin/*
59+

INSTALL.md

Lines changed: 143 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,143 @@
1+
2+
# Installation
3+
4+
*rss2* is a collection of command line programs run from a shell like Bash.
5+
6+
## Compiled version
7+
8+
This is generalized instructions for a release.
9+
10+
Compiled versions are available for Mac OS X (amd64 processor, macosx-amd64), Linux (amd64 process, linux-amd64),
11+
Windows (amd64 processor, windows-amd64) and Rapsberry Pi (arm7 processor, raspbian-arm7)
12+
13+
VERSION_NUMBER is a [symantic version number](http://semver.org/) (e.g. v0.1.2)
14+
15+
16+
For all the released version go to the project page on Github and click latest release
17+
18+
> https://github.com/caltechlibrary/rss2/releases/latest
19+
20+
21+
| Platform | Zip Filename |
22+
|-------------|--------------------------------------------|
23+
| Windows | rss2-VERSION_NUMBER-windows-amd64.zip |
24+
| Mac OS X | rss2-VERSION_NUMBER-macosx-amd64.zip |
25+
| Linux/Intel | rss2-VERSION_NUMBER-linux-amd64.zip |
26+
| Raspbery Pi | rss2-VERSION_NUMBER-raspbian-arm7.zip |
27+
28+
29+
## The basic recipe
30+
31+
+ Find the Zip file listed matching the architecture you're running and download it
32+
+ (e.g. if you're on a Windows 10 laptop/Surface with a amd64 style CPU you'd choose the Zip file with "windows-amd64" in the name).
33+
+ Download the zip file and unzip the file.
34+
+ Copy the contents of the folder named "bin" to a folder that is in your path
35+
+ (e.g. "$HOME/bin" is common).
36+
+ Adjust your PATH if needed
37+
+ (e.g. `export PATH="$HOME/bin:$PATH"`)
38+
+ Test
39+
40+
41+
### Mac OS X
42+
43+
1. Download the zip file
44+
2. Unzip the zip file
45+
3. Copy the executables to $HOME/bin (or a folder in your path)
46+
4. Make sure the new location in in our path
47+
5. Test
48+
49+
Here's an example of the commands run in the Terminal App after downloading the
50+
zip file.
51+
52+
```shell
53+
cd Downloads/
54+
unzip rss2-*-macosx-amd64.zip
55+
mkdir -p $HOME/bin
56+
cp -v bin/* $HOME/bin/
57+
export PATH=$HOME/bin:$PATH
58+
csvfind -version
59+
```
60+
61+
### Windows
62+
63+
1. Download the zip file
64+
2. Unzip the zip file
65+
3. Copy the executables to $HOME/bin (or a folder in your path)
66+
4. Test
67+
68+
Here's an example of the commands run in from the Bash shell on Windows 10 after
69+
downloading the zip file.
70+
71+
```shell
72+
cd Downloads/
73+
unzip rss2-*-windows-amd64.zip
74+
mkdir -p $HOME/bin
75+
cp -v bin/* $HOME/bin/
76+
export PATH=$HOME/bin:$PATH
77+
csvfind -version
78+
```
79+
80+
81+
### Linux
82+
83+
1. Download the zip file
84+
2. Unzip the zip file
85+
3. Copy the executables to $HOME/bin (or a folder in your path)
86+
4. Test
87+
88+
Here's an example of the commands run in from the Bash shell after
89+
downloading the zip file.
90+
91+
```shell
92+
cd Downloads/
93+
unzip rss2-*-linux-amd64.zip
94+
mkdir -p $HOME/bin
95+
cp -v bin/* $HOME/bin/
96+
export PATH=$HOME/bin:$PATH
97+
csvfind -version
98+
```
99+
100+
101+
### Raspberry Pi
102+
103+
Released version is for a Raspberry Pi 2 or later use (i.e. requires ARM 7 support).
104+
105+
1. Download the zip file
106+
2. Unzip the zip file
107+
3. Copy the executables to $HOME/bin (or a folder in your path)
108+
4. Test
109+
110+
Here's an example of the commands run in from the Bash shell after
111+
downloading the zip file.
112+
113+
```shell
114+
cd Downloads/
115+
unzip rss2-*-raspbian-arm7.zip
116+
mkdir -p $HOME/bin
117+
cp -v bin/* $HOME/bin/
118+
export PATH=$HOME/bin:$PATH
119+
csvfind -version
120+
```
121+
122+
123+
## Compiling from source
124+
125+
_rss2_ is "go gettable". Use the "go get" command to download the dependant packages
126+
as well as _rss2_'s source code.
127+
128+
```shell
129+
go get -u github.com/caltechlibrary/rss2/...
130+
```
131+
132+
Or clone the repstory and then compile
133+
134+
```shell
135+
cd
136+
git clone https://github.com/caltechlibrary/rss2 src/github.com/caltechlibrary/rss2
137+
cd src/github.com/caltechlibrary/rss2
138+
make
139+
make test
140+
make install
141+
```
142+
143+

Makefile

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
#
2+
# Simple Makefile for conviently testing, building and deploying experiment.
3+
#
4+
PROJECT = rss2
5+
6+
VERSION = $(shell grep -m 1 'Version =' $(PROJECT).go | cut -d\` -f 2)
7+
8+
BRANCH = $(shell git branch | grep '* ' | cut -d\ -f 2)
9+
10+
OS = $(shell uname)
11+
12+
EXT =
13+
ifeq ($(OS), Windows)
14+
EXT = .exe
15+
endif
16+
17+
PROJECT_LIST = rss2json
18+
19+
build: package $(PROJECT_LIST)
20+
21+
package: rss2.go
22+
go build
23+
24+
rss2json$(EXT): bin/rss2json$(EXT)
25+
26+
bin/rss2json$(EXT): rss2.go cmd/rss2json/rss2json.go
27+
go build -o bin/rss2json$(EXT) cmd/rss2json/rss2json.go
28+
29+
install:
30+
env GOBIN=$(GOPATH)/bin go install cmd/rss2json/rss2json.go
31+
32+
website: page.tmpl README.md nav.md INSTALL.md LICENSE css/site.css
33+
./mk-website.bash
34+
35+
test:
36+
go test
37+
38+
clean:
39+
if [ -d bin ]; then rm -fR bin; fi
40+
if [ -d dist ]; then rm -fR dist; fi
41+
42+
dist/linux-amd64:
43+
mkdir -p dist/bin
44+
env GOOS=linux GOARCH=amd64 go build -o dist/bin/rss2json cmd/rss2json/rss2json.go
45+
cd dist && zip -r $(PROJECT)-$(VERSION)-linux-amd64.zip README.md LICENSE INSTALL.md docs/* scripts/* etc/* bin/*
46+
rm -fR dist/bin
47+
48+
dist/windows-amd64:
49+
mkdir -p dist/bin
50+
env GOOS=windows GOARCH=amd64 go build -o dist/bin/rss2json.exe cmd/rss2json/rss2json.go
51+
cd dist && zip -r $(PROJECT)-$(VERSION)-windows-amd64.zip README.md LICENSE INSTALL.md docs/* scripts/* etc/* bin/*
52+
rm -fR dist/bin
53+
54+
dist/macosx-amd64:
55+
mkdir -p dist/bin
56+
env GOOS=darwin GOARCH=amd64 go build -o dist/bin/rss2json cmd/rss2json/rss2json.go
57+
cd dist && zip -r $(PROJECT)-$(VERSION)-macosx-amd64.zip README.md LICENSE INSTALL.md docs/* scripts/* etc/* bin/*
58+
rm -fR dist/bin
59+
60+
dist/raspbian-arm7:
61+
mkdir -p dist/bin
62+
env GOOS=linux GOARCH=arm GOARM=7 go build -o dist/bin/rss2json cmd/rss2json/rss2json.go
63+
cd dist && zip -r $(PROJECT)-$(VERSION)-raspbian-arm7.zip README.md LICENSE INSTALL.md docs/* scripts/* etc/* bin/*
64+
rm -fR dist/bin
65+
66+
distribute_docs:
67+
mkdir -p dist/etc
68+
mkdir -p dist/scripts
69+
mkdir -p dist/docs
70+
cp -v README.md dist/
71+
cp -v LICENSE dist/
72+
cp -v INSTALL.md dist/
73+
cp -vR docs/* dist/docs/
74+
cp -vR scripts/* dist/scripts/
75+
cp -vR etc/*-example dist/etc/
76+
./package-versions.bash > dist/package-versions.txt
77+
78+
release: distribute_docs dist/linux-amd64 dist/windows-amd64 dist/macosx-amd64 dist/raspbian-arm7
79+
80+
status:
81+
git status
82+
83+
save:
84+
if [ "$(msg)" != "" ]; then git commit -am "$(msg)"; else git commit -am "Quick Save"; fi
85+
git push origin $(BRANCH)
86+
87+
publish:
88+
./mk-website.bash
89+
./publish.bash
90+

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11

22
# rss2
33

4-
A Golang package for working with RSS 2 feeds and documents
4+
A Golang package for working with RSS 2 feeds and documents.
5+
It includes a single cli proof of concept program called
6+
[rss2json](docs/rss2json.html).
7+
58

69

0 commit comments

Comments
 (0)