Skip to content

Commit 8c8ffd5

Browse files
committed
upload
1 parent 68883a4 commit 8c8ffd5

File tree

15 files changed

+724
-1
lines changed

15 files changed

+724
-1
lines changed

.github/workflows/main.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: Build and Sign Debian Packages on Tag
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
branches:
8+
- 'release'
9+
10+
jobs:
11+
build:
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- name: Checkout code
16+
uses: actions/checkout@v3
17+
18+
- name: Install CMake
19+
run: |
20+
sudo apt-get update
21+
sudo apt-get install -y cmake build-essential debhelper devscripts gnupg
22+
23+
- name: Import GPG Key
24+
run: |
25+
echo "${{ secrets.GPG_SECRET_KEY }}" | base64 -d > private.key
26+
gpg --import private.key
27+
rm private.key # Clean up the key file
28+
29+
- name: Build
30+
run: |
31+
mkdir build
32+
cd build
33+
cmake ..
34+
make
35+
36+
- name: Build Debian Package
37+
run: |
38+
cd ..
39+
dpkg-buildpackage -S -sa -d
40+
41+
- name: Sign Debian Package
42+
run: |
43+
cd ..
44+
debsign ../*.changes
45+
46+
- name: Upload Debian Packages
47+
uses: actions/upload-artifact@v3
48+
with:
49+
name: debian-packages
50+
path: ../*.deb

.gitignore

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
build/*
2+
.cache/*
3+
.clangd/*
4+
obj-x86_64-linux-gnu/*
5+
debian/.debhelper/*
6+
debian/ndate/*
7+
debian/usr/*
8+
debian/debhelper-build-stamp/*
9+
debian/files
10+
debian/ndate.substvars
11+
debian/ndate.debhelper.log

CMakeLists.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Minimum CMake version required
2+
cmake_minimum_required(VERSION 3.5)
3+
4+
# Set the project name
5+
project(ndate)
6+
7+
# Add the src subdirectory
8+
add_subdirectory(src)

LICENSE

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
GNU GENERAL PUBLIC LICENSE
2+
Version 3, 29 June 2007
3+
4+
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
5+
Everyone is permitted to copy and distribute verbatim copies
6+
of this license document, but changing it is not allowed.
7+
8+
Preamble
9+
10+
The GNU General Public License is a free, copyleft license for software and other kinds of works. The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users.
11+
12+
When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things.
13+
14+
To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you not to exercise these rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it.
15+
16+
For example, if you distribute copies of such a program, whether gratis or for a fee, you must pass on the same freedoms to the recipients that you received. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights.
17+
18+
We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute, and/or modify the software.
19+
20+
Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations.
21+
22+
Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all.
23+
24+
The precise terms and conditions for copying, distribution, and modification follow.
25+
26+
TERMS AND CONDITIONS
27+
28+
0. Definitions.
29+
30+
This License refers to version 3 of the GNU General Public License.
31+
32+
"Copyright" also means copyright-like laws that apply to other kinds of works, such as semiconductor mask works.
33+
34+
"The Program" refers to any copyrightable work licensed under this License. Each licensee is addressed as "you".
35+
36+
"You" means the individual or entity exercising the permissions granted by this License. "Your" has a corresponding meaning.
37+
38+
"License" means this document.
39+
40+
"Copyright notice" means a copyright notice as used in the program.
41+
42+
"Source code" means the preferred form of the work for making modifications to it. "Object code" means any non-source form of a work.
43+
44+
"Contribution" means any work of authorship, including the original version of the work and any modifications or additions to that work, that is submitted to the Licensor by the Contributor.
45+
46+
"Contributors" are the people who contribute code or documentation to the project.
47+
48+
"Substitute" means an original work or an equivalent work produced using the Program, in whole or in part.
49+
50+
"Modified version" means a work based on the Program or any part of it.
51+
52+
"Propagation" means the inclusion of the work in a product or distribution.
53+
54+
"Redistribution" means any form of distribution including the making available of copies or derivative works.
55+
56+
"Proprietary software" means software that is not free software.
57+
58+
1. Source Code.
59+
60+
The source code for a work is the preferred form of the work for making modifications to it.
61+
62+
2. Basic Permissions.
63+
64+
You are granted the rights to copy, distribute, and/or modify the work, subject to the conditions in this License.
65+
66+
3. Copyleft.
67+
68+
You must keep the GPL notice and a copy of this License with any copies or modified versions of the work. You must also provide access to the source code.
69+
70+
4. Conveying Modified Source Versions.
71+
72+
You may convey modified versions of the work, provided you keep the GPL notice and include a copy of this License. You must also include a prominent notice stating that you have modified the work.
73+
74+
5. Conveying Non-Source Forms.
75+
76+
You may convey non-source forms of the work, provided you provide access to the source code and include a copy of this License.
77+
78+
6. Additional Terms.
79+
80+
You may not impose any further restrictions on the rights granted by this License.
81+
82+
7. No Warranty.
83+
84+
The work is provided "as-is" without any warranty. The authors are not liable for any damages.
85+
86+
8. Termination.
87+
88+
If you violate the terms of this License, the license is terminated automatically.
89+
90+
9. Acceptance.
91+
92+
By copying, distributing, or modifying the work, you accept the terms of this License.
93+
94+
10. GNU General Public License.
95+
96+
This License is intended to protect the rights of users and authors and is designed to ensure that software remains free.
97+
98+
For more details and the complete text, you can refer to the official [GNU GPL v3 License](https://www.gnu.org/licenses/gpl-3.0.html).
99+
S

README.md

Lines changed: 117 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,117 @@
1-
# ndate
1+
## ndate: Bikram Sambat Date Converter
2+
3+
ndate is a command-line tool for displaying and converting dates between the Bikram Sambat (Vikram Samvat) and Gregorian calendars. It's a simple utility designed for easy interaction with these two calendar systems.
4+
5+
### Features
6+
7+
- Display the current Bikram Sambat date.
8+
- Convert dates between Bikram Sambat and Gregorian calendars.
9+
- Supports very long date range.
10+
11+
### Installation
12+
13+
There are two installation methods available: using a Debian package or compiling from source.
14+
15+
#### From Debian Package
16+
17+
1. **Download the latest `.deb` file** from the [releases](https://github.com/khumnath/ndate/releases) page.
18+
2. **Install the package** using `dpkg`:
19+
20+
Bash
21+
22+
```
23+
sudo dpkg -i ndate_1.0.0_amd64.deb
24+
25+
```
26+
27+
Replace `ndate_1.0.0_amd64.deb` with the filename of the downloaded package.
28+
29+
30+
#### From Source
31+
32+
1. Clone the repository:
33+
34+
Bash
35+
```
36+
git clone https://github.com/khumnath/ndate.git
37+
cd ndate
38+
```
39+
40+
2. Install dependencies:
41+
42+
Bash
43+
44+
```
45+
sudo apt-get update
46+
sudo apt-get install -y cmake build-essential debhelper devscripts
47+
48+
```
49+
50+
* packages debhelper and devscripts are for building debian installer package.
51+
52+
3. Build and install:
53+
54+
Bash
55+
56+
```
57+
mkdir build
58+
cd build
59+
cmake ..
60+
make
61+
sudo make install
62+
63+
```
64+
* if need to build deb package, run ``` dpkg-buildpackage -b``` after ```make```
65+
66+
67+
### Usage
68+
69+
Once installed, you can use ndate from the command line. Here are some basic commands:
70+
71+
- Display the current Bikram Sambat date:
72+
73+
Bash
74+
75+
```
76+
ndate
77+
```
78+
output:
79+
![Screenshot_select-area_20240810182013](https://github.com/user-attachments/assets/7b0f2e84-ec09-44a0-9edc-37bd46a682c4)
80+
* Convert to Bikram Sambat
81+
```
82+
ndate --conv --tobs 2024 8 10
83+
```
84+
output:
85+
![Screenshot_select-area_20240810182157](https://github.com/user-attachments/assets/474ff597-829e-4f48-8d16-079673f902fd)
86+
87+
88+
* Convert a Bikram Sambat date to Gregorian:
89+
```
90+
ndate --conv --toad 2081 4 26
91+
92+
```
93+
output:
94+
![Screenshot_select-area_20240810182318](https://github.com/user-attachments/assets/308500ee-15dc-42a3-a1d5-9d5d729b267b)
95+
96+
97+
### ** Replace the date strings with the date you want to convert.
98+
99+
## Contributing
100+
101+
Contributions are welcome! If you have any bug reports or feature requests, please open an issue on the GitHub [repository](https://github.com/khumnath/ndate).
102+
103+
Here's a quick guide to contributing code:
104+
105+
1. Fork the repository.
106+
3. Create a new branch for your changes.
107+
5. Commit your changes and push them to your fork.
108+
7. Open a pull request against the main branch of the original repository.
109+
110+
111+
### License
112+
113+
ndate is released under the [GNU General Public License v3.0](https://www.gnu.org/licenses/gpl-3.0.en.html). See the LICENSE file for more details.
114+
115+
### Contact
116+
117+
For any inquiries, you can reach out to [khumnath](https://khumnath.com.np) cg.

debian/changelog

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
ndate (1.0.0) stable; urgency=medium
2+
3+
* Initial release.
4+
5+
-- khumnath <[email protected]> Fri, 09 Aug 2024 12:00:00 +0000

debian/control

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
Source: ndate
2+
Section: utils
3+
Priority: optional
4+
Maintainer: khumnath <[email protected]>
5+
Build-Depends: debhelper-compat (= 13), cmake
6+
Standards-Version: 4.6.1
7+
Homepage: https://github.com/khumnath/ndate
8+
9+
Package: ndate
10+
Architecture: any
11+
Depends: ${shlibs:Depends}, ${misc:Depends}
12+
Description: Bikram Sambat (Vikram Samvat) date CLI tool
13+
This tool displays the current Bikram Sambat date in the terminal and
14+
converts dates between Bikram Sambat and Gregorian calendar.

debian/copyright

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
2+
Upstream-Name: ndate
3+
Upstream-Contact: khumnath cg <[email protected]>
4+
Source: https://github.com/khumnath/ndate
5+
6+
Files: *
7+
Copyright: 2024 khumnath cg <[email protected]>
8+
License: GPL-3.0+
9+
This program is free software: you can redistribute it and/or modify
10+
it under the terms of the GNU General Public License as published by
11+
the Free Software Foundation, either version 3 of the License, or
12+
(at your option) any later version.
13+
14+
This program is distributed in the hope that it will be useful,
15+
but WITHOUT ANY WARRANTY; without even the implied warranty of
16+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17+
GNU General Public License for more details.
18+
19+
You should have received a copy of the GNU General Public License
20+
along with this program. If not, see <https://www.gnu.org/licenses/>.

debian/rules

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
#!/usr/bin/make -f
2+
3+
# Uncomment this to turn on verbose mode.
4+
# export DH_VERBOSE=1
5+
6+
# Use the `dh` helper for most tasks
7+
%:
8+
dh $@
9+
10+
# Override the `dh_auto_configure` step to call cmake with the /usr/local prefix
11+
override_dh_auto_configure:
12+
dh_auto_configure -- \
13+
14+
-DCMAKE_BUILD_TYPE=Release
15+
16+
# Override the `dh_auto_build` step to use a separate build directory
17+
override_dh_auto_build:
18+
dh_auto_build
19+
# Create a build directory and build
20+
mkdir -p build
21+
cd build && cmake .. && make
22+
23+
# Override the `dh_auto_install` step to install the built files to /usr/local
24+
override_dh_auto_install:
25+
dh_auto_install
26+
# Install from the build directory
27+
cd build && make install DESTDIR=$(CURDIR)/debian
28+
29+
# Clean target to remove the build directory
30+
clean:
31+
dh clean
32+
rm -rf build

debian/source/format

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3.0 (quilt)

0 commit comments

Comments
 (0)