Entropy and variational principle for one-dimensional lattice systems with a general a priori probability: positive and zero temperature